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