Spatie\Authorize\Middleware\Authorize::getModelFromRequest PHP Method

getModelFromRequest() protected method

Get the model from the request using given boundModelName.
protected getModelFromRequest ( mixed $request, string $boundModelName ) : Model | null
$request mixed
$boundModelName string
return Illuminate\Database\Eloquent\Model | null
    protected function getModelFromRequest($request, $boundModelName)
    {
        if (is_null($boundModelName)) {
            return;
        }
        return $request->route($boundModelName);
    }