Route with parameters in menu.php
Hi sir,
How can I add route with parameters in menu.php? For example the declared route in web.php is
Route::get('test/{id}', 'TestController@index')->name('test.index);
array(
'title' => 'Test',
'path' => 'test/1',
'bullet' => '',
),
How can I add the parameters without it being declared as new route?
Thank you
Replies (6)
Hi aveimoug,
Could you please try to use the config like this?
'test' => array(
'title' => 'Test',
'*' => array(
'title' => 'Show Text',
'edit' => array(
'title' => 'Edit Test',
),
),
),
Thanks
Thank you, it helps a lot. I put it into the pages.php
I'm sorry, I want to ask another question,
For example I declared it as below:
'test' => array(
'title' => 'Test',
'view' => 'test/index',
'*' => array(
'title' => 'Show Text',
'edit' => array(
'title' => 'Edit Test',
),
),
),
Will the 'view' => 'test/index' go through controller first or will it jump to the blade file without going to controller?
Your help and support is greatly appreciated.
Thank you
Thank you for your reply, will this be in menu.php or pages.php?
Hi,
The config is for pages.php.
The 'view' => 'test/index' go through controller first. You can see it here.app/Http/Controllers/PagesController.php
Thanks
Thank you very much,
You're welcome. Feel free to let us know if you need any help.
Thanks