Illuminate\Routing\Router::current PHP Method

current() public method

Get the currently dispatched route instance.
public current ( ) : Illuminate\Routing\Route
return Illuminate\Routing\Route
    public function current()
    {
        return $this->current;
    }

Usage Example

Example #1
0
 /**
  * Get the name of the resource currently being accessed.
  *
  * @return string
  */
 public function getCurrentResource()
 {
     if ($currentRoute = $this->router->current()) {
         return $currentRoute->getAction()['resource'];
     }
     return null;
 }
All Usage Examples Of Illuminate\Routing\Router::current