Quick tip on using named routes in Laravel

Categorized as Laravel Tagged

If you like to use route names in your Laravel projects, this tip might be helpful to you. You can assign the named method on a route instance to find if the current request was directed to a given named route.

if($request->route()->named('post')) {
	// code here
}

Leave a reply

Your email address will not be published.