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

Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(

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

Your Support Matters!

We will highly appreciate your Metronic Review on Themeforest.
Please go to Themeforest Downloads page, select Metronic & leave your feedback.
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Here's a how to add some HTML formatting to your comment:
  • <pre></pre> for JS codes block
  • <pre lang="html"></pre> for HTML code block
  • <pre lang="scss"></pre> for SCSS code block
  • <pre lang="php"></pre> for PHP code block
  • <code></code> for single line of code
  • <strong></strong> to make things bold
  • <em></em> to emphasize
  • <ul><li></li></ul>  to make list
  • <ol><li></li></ol>  to make ordered list
  • <h3></h3> to make headings
  • <a></a> for links
  • <img> to paste in an image
  • <blockquote></blockquote> to quote somebody
  • happy  :)
  • shocked  :|
  • sad  :(