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\Exceptions;
4
 
5
use Illuminate\Auth\Access\AuthorizationException;
6
use Illuminate\Support\Arr;
7
 
8
class MissingScopeException extends AuthorizationException
9
{
10
    /**
11
     * The scopes that the user did not have.
12
     *
13
     * @var array
14
     */
15
    protected $scopes;
16
 
17
    /**
18
     * Create a new missing scope exception.
19
     *
20
     * @param  array|string  $scopes
21
     * @param  string  $message
22
     * @return void
23
     */
24
    public function __construct($scopes = [], $message = 'Invalid scope(s) provided.')
25
    {
26
        parent::__construct($message);
27
 
28
        $this->scopes = Arr::wrap($scopes);
29
    }
30
 
31
    /**
32
     * Get the scopes that the user did not have.
33
     *
34
     * @return array
35
     */
36
    public function scopes()
37
    {
38
        return $this->scopes;
39
    }
40
}