App\Http\Requests\EntityRequest::authorize PHP Method

authorize() public method

public authorize ( )
    public function authorize()
    {
        if ($this->entity()) {
            if ($this->user()->can('view', $this->entity())) {
                HistoryUtils::trackViewed($this->entity());
                return true;
            }
        } else {
            return $this->user()->can('create', $this->entityType);
        }
    }