I'm in developing a dynamic view composer and I need to get the values of routes.
for example, I have these three routes:
Route::group(['prefix' => 'join', 'as' => 'join-'], function () {
Route::get('/', 'JoinController@index')->name('index');
Route::group(['prefix' => '{j}/signin', 'as' => 'signin-'], function () {
Route::get('/', 'SigninController@index')->name('index');
Route::group(['prefix' => '{f}/forget', 'as' => 'forget-'], function () {
Route::get('/', 'ForgetController@index')->name('index');
});
});
});
now I want to catch the $j
and $f
values in my view composer.
I can get the name of my routes via Route::currentRouteName()
but I need to get the values that passed to this routes.
because I need to use route()
to create a link, for join-
there is no any problem because we don't need to pass any parameter but in join-signin-
and join-signin-forget-
I have Laravel error.