Laravel 5.4: Fluent Routing

Laravel 5.4 has released another pretty cool routing improvement. In this post, I would like to show you the improved fluent Registering Routes.

In the past, you used to define a named route like this at the end of the closure –

Now you can define it at the beginning, as shown below –

Same way you can define your middleware also, here the example-

You can chain and use together both middleware and named routes, as shown below –

Registering a middleware with a route prefix and group

Registering a middleware to a resource controller

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

0 0 vote
Article Rating
Notify of
1 Comment
Newest Most Voted
Inline Feedbacks
View all comments Protection Status
Would love your thoughts, please comment.x