Silber\Bouncer\Bouncer::getGate PHP Метод

getGate() публичный Метод

Get the gate instance.
public getGate ( $throw = false ) : Illuminate\Contracts\Auth\Access\Gate | null
Результат Illuminate\Contracts\Auth\Access\Gate | null
    public function getGate($throw = false)
    {
        if ($this->gate) {
            return $this->gate;
        }
        if ($throw) {
            throw new RuntimeException('The gate instance has not been set.');
        }
        return null;
    }

Usage Example

Пример #1
0
 /**
  * Get the gate instance.
  *
  * @return \Illuminate\Contracts\Auth\Access\Gate|null 
  * @throws \RuntimeException
  * @static 
  */
 public static function getGate($throw = false)
 {
     return \Silber\Bouncer\Bouncer::getGate($throw);
 }