App\Http\Requests\CreateDocumentRequest::authorize PHP Метод

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

Determine if the user is authorized to make this request.
public authorize ( ) : boolean
Результат boolean
    public function authorize()
    {
        if (!$this->user()->hasFeature(FEATURE_DOCUMENTS)) {
            return false;
        }
        if ($this->invoice && $this->user()->cannot('edit', $this->invoice)) {
            return false;
        }
        if ($this->expense && $this->user()->cannot('edit', $this->expense)) {
            return false;
        }
        return $this->user()->can('create', ENTITY_DOCUMENT);
    }
CreateDocumentRequest