is() public method

Alias for the "currentRouteNamed" method.
public is ( ) : boolean
return boolean
Example #1
0
 /**
  * Define the routes for the application.
  *
  * @param  \Illuminate\Routing\Router $router
  * @return void
  */
 public function map(Router $router)
 {
     $router->bind('widget', function ($id) use($router) {
         if ($router->is('administrator*')) {
             return Widget::withoutGlobalScope('menu_assignment')->findOrFail($id);
         }
         return Widget::findOrFail($id);
     });
     $this->mapWebRoutes($router);
 }
Example #2
0
 /**
  * Alias for the "currentRouteNamed" method.
  *
  * @param mixed  string
  * @return bool 
  * @static 
  */
 public static function is()
 {
     return \Illuminate\Routing\Router::is();
 }