1 | <?php |
||
14 | class Role extends BaseRole |
||
15 | { |
||
16 | use Auditable; |
||
17 | use HashidsTrait; |
||
18 | use LogsActivity; |
||
19 | use ValidatingTrait; |
||
20 | use HasTranslations; |
||
21 | |||
22 | /** |
||
23 | * {@inheritdoc} |
||
24 | */ |
||
25 | protected $fillable = [ |
||
26 | 'name', |
||
27 | 'title', |
||
28 | 'scope', |
||
29 | 'abilities', |
||
30 | ]; |
||
31 | |||
32 | /** |
||
33 | * {@inheritdoc} |
||
34 | */ |
||
35 | protected $casts = [ |
||
36 | 'name' => 'string', |
||
37 | 'title' => 'string', |
||
38 | 'scope' => 'integer', |
||
39 | ]; |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | protected $observables = [ |
||
45 | 'validating', |
||
46 | 'validated', |
||
47 | ]; |
||
48 | |||
49 | /** |
||
50 | * The attributes that are translatable. |
||
51 | * |
||
52 | * @var array |
||
53 | */ |
||
54 | public $translatable = [ |
||
55 | 'title', |
||
56 | ]; |
||
57 | |||
58 | /** |
||
59 | * The default rules that the model will validate against. |
||
60 | * |
||
61 | * @var array |
||
62 | */ |
||
63 | protected $rules = []; |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | protected $validationMessages = [ |
||
69 | 'name.unique' => 'The combination of (name & scope) fields has already been taken.', |
||
70 | 'scope.unique' => 'The combination of (name & scope) fields has already been taken.', |
||
71 | ]; |
||
72 | |||
73 | /** |
||
74 | * Whether the model should throw a |
||
75 | * ValidationException if it fails validation. |
||
76 | * |
||
77 | * @var bool |
||
78 | */ |
||
79 | protected $throwValidationExceptions = true; |
||
80 | |||
81 | /** |
||
82 | * Indicates whether to log only dirty attributes or all. |
||
83 | * |
||
84 | * @var bool |
||
85 | */ |
||
86 | protected static $logOnlyDirty = true; |
||
87 | |||
88 | /** |
||
89 | * The attributes that are logged on change. |
||
90 | * |
||
91 | * @var array |
||
92 | */ |
||
93 | protected static $logFillable = true; |
||
94 | |||
95 | /** |
||
96 | * The attributes that are ignored on change. |
||
97 | * |
||
98 | * @var array |
||
99 | */ |
||
100 | protected static $ignoreChangedAttributes = [ |
||
101 | 'created_at', |
||
102 | 'updated_at', |
||
103 | ]; |
||
104 | |||
105 | /** |
||
106 | * Create a new Eloquent model instance. |
||
107 | * |
||
108 | * @param array $attributes |
||
109 | */ |
||
110 | public function __construct(array $attributes = []) |
||
120 | |||
121 | /** |
||
122 | * Attach the given abilities to the model. |
||
123 | * |
||
124 | * @param mixed $abilities |
||
125 | * |
||
126 | * @return void |
||
127 | */ |
||
128 | public function setAbilitiesAttribute($abilities): void |
||
142 | } |
||
143 |
It seems like you are assigning to a variable which was imported through a
use
statement which was not imported by reference.For clarity, we suggest to use a different name or import by reference depending on whether you would like to have the change visibile in outer-scope.
Change not visible in outer-scope
Change visible in outer-scope