Example #1
0
 /**
  * Create a new stinter instance.
  *
  * @param GateContract $gate
  * @param string|null $ability Name used to call the restriction
  */
 public function __construct(GateContract $gate, $ability = null)
 {
     $this->stint = is_string($ability) ? $ability : static::class;
     $gate->before([$this, 'before']);
     $gate->define($this->stint, [$this, 'check']);
     $gate->after([$this, 'after']);
 }