1 | <?php |
||
13 | class Ability extends BaseAbility |
||
14 | { |
||
15 | use Auditable; |
||
16 | use LogsActivity; |
||
17 | use HasTranslations; |
||
18 | use ValidatingTrait; |
||
19 | |||
20 | /** |
||
21 | * {@inheritdoc} |
||
22 | */ |
||
23 | protected $fillable = [ |
||
24 | 'name', |
||
25 | 'title', |
||
26 | 'entity_id', |
||
27 | 'entity_type', |
||
28 | 'only_owned', |
||
29 | 'scope', |
||
30 | 'roles', |
||
31 | ]; |
||
32 | |||
33 | /** |
||
34 | * {@inheritdoc} |
||
35 | */ |
||
36 | protected $casts = [ |
||
37 | 'name' => 'string', |
||
38 | 'title' => 'string', |
||
39 | 'entity_id' => 'integer', |
||
40 | 'entity_type' => 'string', |
||
41 | 'only_owned' => 'boolean', |
||
42 | 'scope' => 'integer', |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | protected $observables = [ |
||
49 | 'validating', |
||
50 | 'validated', |
||
51 | ]; |
||
52 | |||
53 | /** |
||
54 | * The attributes that are translatable. |
||
55 | * |
||
56 | * @var array |
||
57 | */ |
||
58 | public $translatable = [ |
||
59 | 'title', |
||
60 | ]; |
||
61 | |||
62 | /** |
||
63 | * The default rules that the model will validate against. |
||
64 | * |
||
65 | * @var array |
||
66 | */ |
||
67 | protected $rules = [ |
||
68 | 'title' => 'required|string', |
||
69 | 'name' => 'required|string|max:150', |
||
70 | 'entity_id' => 'nullable|integer', |
||
71 | 'entity_type' => 'nullable|string', |
||
72 | 'only_owned' => 'sometimes|boolean', |
||
73 | 'scope' => 'nullable|integer', |
||
74 | ]; |
||
75 | |||
76 | /** |
||
77 | * Whether the model should throw a |
||
78 | * ValidationException if it fails validation. |
||
79 | * |
||
80 | * @var bool |
||
81 | */ |
||
82 | protected $throwValidationExceptions = true; |
||
83 | |||
84 | /** |
||
85 | * Indicates whether to log only dirty attributes or all. |
||
86 | * |
||
87 | * @var bool |
||
88 | */ |
||
89 | protected static $logOnlyDirty = true; |
||
90 | |||
91 | /** |
||
92 | * The attributes that are logged on change. |
||
93 | * |
||
94 | * @var array |
||
95 | */ |
||
96 | protected static $logFillable = true; |
||
97 | |||
98 | /** |
||
99 | * The attributes that are ignored on change. |
||
100 | * |
||
101 | * @var array |
||
102 | */ |
||
103 | protected static $ignoreChangedAttributes = [ |
||
104 | 'created_at', |
||
105 | 'updated_at', |
||
106 | ]; |
||
107 | |||
108 | /** |
||
109 | * Attach the given roles to the model. |
||
110 | * |
||
111 | * @param mixed $roles |
||
112 | * |
||
113 | * @return void |
||
114 | */ |
||
115 | public function setRolesAttribute($roles): void |
||
129 | } |
||
130 |
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