1 | <?php |
||
14 | class Manager extends User |
||
15 | { |
||
16 | use Tenantable; |
||
17 | |||
18 | /** |
||
19 | * {@inheritdoc} |
||
20 | */ |
||
21 | protected $fillable = [ |
||
22 | 'username', |
||
23 | 'password', |
||
24 | 'two_factor', |
||
25 | 'email', |
||
26 | 'email_verified', |
||
27 | 'email_verified_at', |
||
28 | 'phone', |
||
29 | 'phone_verified', |
||
30 | 'phone_verified_at', |
||
31 | 'full_name', |
||
32 | 'title', |
||
33 | 'country_code', |
||
34 | 'language_code', |
||
35 | 'birthday', |
||
36 | 'gender', |
||
37 | 'is_active', |
||
38 | 'last_activity', |
||
39 | 'abilities', |
||
40 | 'roles', |
||
41 | 'tenants', |
||
42 | ]; |
||
43 | |||
44 | /** |
||
45 | * {@inheritdoc} |
||
46 | */ |
||
47 | protected $passwordResetNotificationClass = ManagerPasswordResetNotification::class; |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | protected $emailVerificationNotificationClass = ManagerEmailVerificationNotification::class; |
||
53 | |||
54 | /** |
||
55 | * {@inheritdoc} |
||
56 | */ |
||
57 | protected $phoneVerificationNotificationClass = PhoneVerificationNotification::class; |
||
58 | |||
59 | /** |
||
60 | * Create a new Eloquent model instance. |
||
61 | * |
||
62 | * @param array $attributes |
||
63 | */ |
||
64 | public function __construct(array $attributes = []) |
||
90 | |||
91 | /** |
||
92 | * Attach the given tenants to the model. |
||
93 | * |
||
94 | * @param mixed $tenants |
||
95 | * |
||
96 | * @return void |
||
97 | */ |
||
98 | public function setTenantsAttribute($tenants): void |
||
112 | |||
113 | /** |
||
114 | * Get all attached tenants to the manager. |
||
115 | * |
||
116 | * @return \Illuminate\Database\Eloquent\Relations\MorphToMany |
||
117 | */ |
||
118 | public function tenants(): MorphToMany |
||
123 | |||
124 | /** |
||
125 | * Determine if manager is owner of the given tenant. |
||
126 | * |
||
127 | * @param \Illuminate\Database\Eloquent\Model $tenant |
||
128 | * |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function isOwner(Model $tenant): bool |
||
135 | |||
136 | /** |
||
137 | * Determine if manager is staff of the given tenant. |
||
138 | * |
||
139 | * @param \Illuminate\Database\Eloquent\Model $tenant |
||
140 | * |
||
141 | * @return bool |
||
142 | */ |
||
143 | public function isStaff(Model $tenant): bool |
||
147 | |||
148 | /** |
||
149 | * Get the route key for the model. |
||
150 | * |
||
151 | * @return string |
||
152 | */ |
||
153 | public function getRouteKeyName() |
||
157 | } |
||
158 |
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