Silber\Bouncer\Bouncer::setGate PHP Méthode

setGate() public méthode

Set the access gate instance.
public setGate ( Illuminate\Contracts\Auth\Access\Gate $gate )
$gate Illuminate\Contracts\Auth\Access\Gate
    public function setGate(Gate $gate)
    {
        $this->gate = $gate;
        return $this;
    }

Usage Example

 /**
  * Register the bouncer as a singleton.
  *
  * @return void
  */
 protected function registerBouncer()
 {
     $this->app->singleton(Bouncer::class, function () {
         $bouncer = new Bouncer($this->app->make(Clipboard::class), $this->app->make(Seeder::class));
         return $bouncer->setGate($this->app->make(Gate::class));
     });
 }
All Usage Examples Of Silber\Bouncer\Bouncer::setGate