Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Laravel\Sanctum\Http\Middleware;
4
 
5
use Laravel\Sanctum\Exceptions\MissingScopeException;
6
 
7
/**
8
 * @deprecated
9
 * @see \Laravel\Sanctum\Http\Middleware\CheckAbilities
10
 */
11
class CheckScopes
12
{
13
    /**
14
     * Handle the incoming request.
15
     *
16
     * @param  \Illuminate\Http\Request  $request
17
     * @param  \Closure  $next
18
     * @param  mixed  ...$scopes
19
     * @return \Illuminate\Http\Response
20
     *
21
     * @throws \Illuminate\Auth\AuthenticationException|\Laravel\Sanctum\Exceptions\MissingScopeException
22
     */
23
    public function handle($request, $next, ...$scopes)
24
    {
25
        try {
26
            return (new CheckAbilities())->handle($request, $next, ...$scopes);
27
        } catch (\Laravel\Sanctum\Exceptions\MissingAbilityException $e) {
28
            throw new MissingScopeException($e->abilities());
29
        }
30
    }
31
}