1 | <?php |
||
2 | |||
3 | declare(strict_types=1); |
||
4 | |||
5 | namespace App\Models; |
||
6 | |||
7 | use Illuminate\Database\Eloquent\Model; |
||
8 | use Illuminate\Database\Eloquent\Relations\BelongsTo; |
||
9 | |||
10 | final class UserToken extends Model |
||
11 | { |
||
12 | protected $fillable = [ |
||
13 | 'token', |
||
14 | ]; |
||
15 | |||
16 | 2 | public function user(): BelongsTo |
|
17 | { |
||
18 | 2 | return $this->belongsTo(User::class); |
|
19 | } |
||
20 | |||
21 | 2 | public function getUser(): User |
|
22 | { |
||
23 | 2 | return $this->getRelationValue('user'); |
|
0 ignored issues
–
show
Bug
Best Practice
introduced
by
![]() |
|||
24 | } |
||
25 | } |
||
26 |