Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在laravel中将Url路径从文件路径名更改为其他名称_Laravel_Laravel 5_Laravel 4_Laravel 5.2_Laravel 5.3 - Fatal编程技术网

如何在laravel中将Url路径从文件路径名更改为其他名称

如何在laravel中将Url路径从文件路径名更改为其他名称,laravel,laravel-5,laravel-4,laravel-5.2,laravel-5.3,Laravel,Laravel 5,Laravel 4,Laravel 5.2,Laravel 5.3,在路线代码下方 Route::get('clientlayout.main.index','InvoiceTicketController@show'); Route::get('clientlayout.main.mydomains','InvoiceTicketController@set'); 当我运行这些路由时,我得到的url是 及 . 我希望我的Url更改如下:和 请为我提供一个更改路线的解决方案,以纠正此问题 Route::get('/index','InvoiceTicketC

在路线代码下方

Route::get('clientlayout.main.index','InvoiceTicketController@show');
Route::get('clientlayout.main.mydomains','InvoiceTicketController@set');
当我运行这些路由时,我得到的url是

及 .

我希望我的Url更改如下:和

请为我提供一个更改路线的解决方案,以纠正此问题

Route::get('/index','InvoiceTicketController@show');
Route::get('/mydomains','InvoiceTicketController@set');
对于命名路由,可以这样使用

 Route::get('/index','InvoiceTicketController@show')->name('clientlayout.main.index');
更多详情请参见

对于命名路由,可以这样使用

 Route::get('/index','InvoiceTicketController@show')->name('clientlayout.main.index');
更多详情请参见


你应该试试这条路线。

Route::get('/clientlayout/main/index','InvoiceTicketController@show');
Route::get('/clientlayout/main/mydomains','InvoiceTicketController@set');
Url正在生成

或者你应该试试

Route::get('/index','InvoiceTicketController@show');
Route::get('/mydomains','InvoiceTicketController@set');
然后Url正在生成


你应该试试这条路线。

Route::get('/clientlayout/main/index','InvoiceTicketController@show');
Route::get('/clientlayout/main/mydomains','InvoiceTicketController@set');
Url正在生成

或者你应该试试

Route::get('/index','InvoiceTicketController@show');
Route::get('/mydomains','InvoiceTicketController@set');
然后Url正在生成

使用
Route::get('/index','InvoiceTicketController@show');
路由::get('/mydomains','InvoiceTicketController@set');而不是路由使用
路由::get('/index','InvoiceTicketController@show');
路由::get('/mydomains','InvoiceTicketController@set');而不是您的路线