| Total Complexity | 9 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | class User extends \App\Models\User |
||
| 8 | { |
||
| 9 | use Traits\HasProperty; |
||
|
|
|||
| 10 | |||
| 11 | /** |
||
| 12 | * Get the values of the properties. |
||
| 13 | * |
||
| 14 | * @return Attribute |
||
| 15 | */ |
||
| 16 | protected function city(): Attribute |
||
| 17 | { |
||
| 18 | return Attribute::make( |
||
| 19 | get: fn() => $this->profile ? $this->profile->city : '', |
||
| 20 | ); |
||
| 21 | } |
||
| 22 | |||
| 23 | /** |
||
| 24 | * @return Attribute |
||
| 25 | */ |
||
| 26 | protected function countryCode(): Attribute |
||
| 30 | ); |
||
| 31 | } |
||
| 32 | |||
| 33 | /** |
||
| 34 | * @return Attribute |
||
| 35 | */ |
||
| 36 | protected function locale(): Attribute |
||
| 37 | { |
||
| 38 | return Attribute::make( |
||
| 39 | get: fn() => $this->properties['locale'] ?? 'fr', |
||
| 40 | ); |
||
| 41 | } |
||
| 42 | |||
| 43 | public function profile() |
||
| 44 | { |
||
| 45 | return $this->hasOne(Profile::class); |
||
| 46 | } |
||
| 47 | |||
| 48 | public function guilds() |
||
| 49 | { |
||
| 50 | return $this->hasMany(Guild::class)->orderBy('guilds.id', 'desc'); |
||
| 51 | } |
||
| 52 | |||
| 53 | public function host_invites() |
||
| 56 | } |
||
| 57 | |||
| 58 | public function guest_invites() |
||
| 61 | } |
||
| 62 | } |
||
| 63 |