Skip to content

Instantly share code, notes, and snippets.

@Braunson
Created June 23, 2021 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Braunson/47d2b3b5f12e137eb538814d0baf47ae to your computer and use it in GitHub Desktop.
Save Braunson/47d2b3b5f12e137eb538814d0baf47ae to your computer and use it in GitHub Desktop.
Laravel - Get information about a named route
$route = \Route::getRoutes()->getByName('home');
// => Illuminate\Routing\Route {
// +uri: "/",
// +methods: [
// "GET",
// "HEAD",
// ],
// +action: [
// "middleware" => [
// "web",
// ],
// "uses" => "App\Http\Controllers\HomeController@homepage",
// "controller" => "App\Http\Controllers\HomeController@homepage",
// "namespace" => "App\Http\Controllers",
// "prefix" => null,
// "where" => [],
// "as" => "home",
// ],
// +isFallback: false,
// +controller: null,
// +defaults: [],
// +wheres: [],
// +parameters: null,
// +parameterNames: null,
// +computedMiddleware: null,
// +compiled: null,
// }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment