How to create route name in laravel 5?



How to create route name in laravel 5?..

Answer / Juned Ahmad

In Laravel 5, you can create a named route by providing the second argument of the Route::get() method (or other route creation methods). Here's an example:nn$tRoute::get('/users', 'UserController@index')->name('user_index');nnIn this example, we've created a route for listing users and given it the name 'user_index'. You can then use this named route elsewhere in your application, like links or form actions.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Laravel PHP Framework Interview Questions

Explain how to create a controller in laravel?

1 Answers  


How we can get user's detail when he is logged in using auth?

1 Answers  


Explain how to add csrf protection in laravel?

1 Answers  


What is schema in laravel?

1 Answers  


What are Global Middleware and Route Middleware ?

1 Answers  


Is laravel an mvc framework?

1 Answers  


Is laravel support caching? Explain

1 Answers  


How to create custom middleware in laravel?

1 Answers  


What getfacadeaccessor method does?

1 Answers  


What service provider’s register method does?

1 Answers  


What are events in laravel?

1 Answers  


What is a Composer command ?

1 Answers  


Categories