laravel 控制器获取当前路由链接 并传递参数
routes.php
Route::prefix('case')->group(function () { Route::get('/page/{page?}', 'Cms\CaseController@index')->name('cms.case.page.rewrite'); //url rewrite });
控制器
dump(redirect()->route('cms.case.page.rewrite', ['page' => 1])->getTargetUrl());