laravel request route name code example

Example 1: laravel get current route name

Route::currentRouteName()

Example 2: laravel get route

Route::get('foo', function () {
    return 'Hello World';
});

Example 3: laravel get route

Route::get('/user', 'UserController@index');

Example 4: laravel get current route name

Route::getCurrentRoute()->getActionName();

Example 5: laravel routes return view in web.php

Route::get("/page", function(){
   return View::make("dir.page");
});

Example 6: laravel route

Route::view('/welcome', 'welcome');

Route::view('/welcome', 'welcome', ['name' => 'Taylor']);

Tags:

Php Example