dimanche 18 octobre 2015

Access Route params in constructor - Laravel 5.1

I have this code below from my old Laravel 4.x. I am wondering how can I access the route params in the constructor(or in a middleware) like $route->parameter('projects');, or should I ask what is the equivalent of that to Laravel 5.1.

thanks!

public function __construct()
{
    $this->beforeFilter(function($route, $request)
    {
      $this->user     = Auth::user();
      $this->project  = $this->user->getProject( $route->parameter('projects') );
      $this->group    = $this->project->groups()->find( $route->parameter('groups') );
    });
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire