|
5 | 5 | namespace App\Models; |
6 | 6 |
|
7 | 7 | use Carbon\CarbonInterface; |
| 8 | +use Database\Factories\UserFactory; |
| 9 | +use Illuminate\Database\Eloquent\Attributes\Hidden; |
| 10 | +use Illuminate\Database\Eloquent\Concerns\HasUlids; |
8 | 11 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
9 | 12 | use Illuminate\Foundation\Auth\User as Authenticatable; |
10 | 13 |
|
11 | 14 | /** |
12 | | - * @property-read int $id |
| 15 | + * @property-read string $id |
13 | 16 | * @property-read string $name |
| 17 | + * @property-read string|null $display_name |
14 | 18 | * @property-read string $email |
| 19 | + * @property-read string|null $notification_email |
15 | 20 | * @property-read CarbonInterface|null $email_verified_at |
| 21 | + * @property-read CarbonInterface|null $notification_email_verified_at |
16 | 22 | * @property-read string $password |
| 23 | + * @property-read string|null $remember_token |
| 24 | + * @property-read string|null $two_factor_secret |
| 25 | + * @property-read string|null $two_factor_recovery_codes |
| 26 | + * @property-read CarbonInterface|null $two_factor_confirmed_at |
17 | 27 | * @property-read CarbonInterface $created_at |
18 | 28 | * @property-read CarbonInterface $updated_at |
19 | 29 | */ |
| 30 | +#[Hidden(['password', 'remember_token', 'two_factor_secret', 'two_factor_recovery_codes'])] |
20 | 31 | final class User extends Authenticatable |
21 | 32 | { |
22 | | - /** @use HasFactory<\Database\Factories\UserFactory> */ |
| 33 | + /** @use HasFactory<UserFactory> */ |
23 | 34 | use HasFactory; |
| 35 | + use HasUlids; |
24 | 36 |
|
25 | | - /** |
26 | | - * The attributes that should be hidden for serialization. |
27 | | - * |
28 | | - * @var list<string> |
29 | | - */ |
30 | | - protected $hidden = [ |
31 | | - 'password', |
32 | | - ]; |
33 | | - |
34 | | - /** |
35 | | - * Get the attributes that should be cast. |
36 | | - * |
37 | | - * @return array<string, string> |
38 | | - */ |
39 | 37 | protected function casts(): array |
40 | 38 | { |
41 | 39 | return [ |
42 | | - 'id' => 'int', |
| 40 | + 'id' => 'string', |
43 | 41 | 'name' => 'string', |
| 42 | + 'display_name' => 'string', |
44 | 43 | 'email' => 'string', |
| 44 | + 'notification_email' => 'string', |
45 | 45 | 'email_verified_at' => 'datetime', |
| 46 | + 'notification_email_verified_at' => 'datetime', |
46 | 47 | 'password' => 'hashed', |
| 48 | + 'remember_token' => 'string', |
| 49 | + 'two_factor_secret' => 'encrypted', |
| 50 | + 'two_factor_recovery_codes' => 'encrypted', |
| 51 | + 'two_factor_confirmed_at' => 'datetime', |
47 | 52 | 'created_at' => 'datetime', |
48 | 53 | 'updated_at' => 'datetime', |
49 | 54 | ]; |
|
0 commit comments