PHP 클래스 Spatie\Authorize\Middleware\Authorize

파일 보기 프로젝트 열기: spatie/laravel-authorize

공개 메소드들

메소드 설명
handle ( Illuminate\Http\Request $request, Closure $next, string | null $ability = null, string | null $boundModelName = null ) : mixed Handle an incoming request.

보호된 메소드들

메소드 설명
getModelFromRequest ( mixed $request, string $boundModelName ) : Model | null Get the model from the request using given boundModelName.
handleUnauthorizedRequest ( $request, string | null $ability = null, Model | null $model = null ) : Illuminate\Contracts\Routing\ResponseFactory | Illuminate\Http\RedirectResponse | Response Handle the unauthorized request.
hasRequiredAbility ( $user, string | null $ability = null, Model | null $model = null ) : boolean Determine if the currently logged in use has the given ability.

메소드 상세

getModelFromRequest() 보호된 메소드

Get the model from the request using given boundModelName.
protected getModelFromRequest ( mixed $request, string $boundModelName ) : Model | null
$request mixed
$boundModelName string
리턴 Illuminate\Database\Eloquent\Model | null

handle() 공개 메소드

Handle an incoming request.
public handle ( Illuminate\Http\Request $request, Closure $next, string | null $ability = null, string | null $boundModelName = null ) : mixed
$request Illuminate\Http\Request
$next Closure
$ability string | null
$boundModelName string | null
리턴 mixed

handleUnauthorizedRequest() 보호된 메소드

Handle the unauthorized request.
protected handleUnauthorizedRequest ( $request, string | null $ability = null, Model | null $model = null ) : Illuminate\Contracts\Routing\ResponseFactory | Illuminate\Http\RedirectResponse | Response
$request
$ability string | null
$model Illuminate\Database\Eloquent\Model | null
리턴 Illuminate\Contracts\Routing\ResponseFactory | Illuminate\Http\RedirectResponse | Symfony\Component\HttpFoundation\Response

hasRequiredAbility() 보호된 메소드

Determine if the currently logged in use has the given ability.
protected hasRequiredAbility ( $user, string | null $ability = null, Model | null $model = null ) : boolean
$user
$ability string | null
$model Illuminate\Database\Eloquent\Model | null
리턴 boolean