Illuminate\Routing\Router::get PHP Method

get() public method

Register a new GET route with the router.
public get ( string $uri, Closure | array | string | null $action = null ) : Illuminate\Routing\Route
$uri string
$action Closure | array | string | null
return Illuminate\Routing\Route
    public function get($uri, $action = null)
    {
        return $this->addRoute(['GET', 'HEAD'], $uri, $action);
    }

Usage Example

 /**
  * @param Router $router
  */
 public function map(Router $router)
 {
     $router->group(['namespace' => $this->namespace, 'prefix' => 'backend', 'middleware' => ['web', 'theme:backend', 'lang', 'configure:backend']], function (Router $router) {
         $router->get('/', function () {
             return redirect(url('backend/c/dashboard'));
         });
         $router->group(['middleware' => 'guest'], function (Router $router) {
             $router->get('login', 'Auth\\AuthController@getLogin');
             $router->post('login', 'Auth\\AuthController@postLogin');
             $router->get('forgot-password', 'Auth\\PasswordController@getEmail');
             $router->post('forgot-password', 'Auth\\PasswordController@postEmail');
             $router->get('reset-password/{code}', 'Auth\\PasswordController@getReset');
             $router->post('reset-password', 'Auth\\PasswordController@postReset');
         });
         $router->group(['middleware' => 'auth:admin'], function (Router $router) {
             $router->get('logout', function () {
                 \Auth::logout();
                 \Session::flush();
                 return redirect('/backend/login');
             });
             $router->any('c/{controller}', function (Request $request, $controller) {
                 return app()->call($this->namespace . '\\' . ucfirst($controller) . 'Controller@' . ucfirst(strtolower($request->method())) . 'Index');
             });
             $router->any('c/{controller}/a/{action}', function (Request $request, $controller, $action) {
                 return app()->call($this->namespace . '\\' . ucfirst($controller) . 'Controller@' . ucfirst(strtolower($request->method())) . ucfirst(strtolower($action)));
             });
         });
     });
 }
All Usage Examples Of Illuminate\Routing\Router::get