1 | <?php |
||
2 | |||
3 | /** |
||
4 | * Token. |
||
5 | */ |
||
6 | |||
7 | namespace Bmatovu\MtnMomo\Models; |
||
8 | |||
9 | use Bmatovu\MtnMomo\Database\Factories\TokenFactory; |
||
10 | use Bmatovu\MtnMomo\Traits\TokenUtilTrait; |
||
11 | use Bmatovu\OAuthNegotiator\Models\TokenInterface; |
||
12 | use Illuminate\Database\Eloquent\Factories\HasFactory; |
||
13 | use Illuminate\Database\Eloquent\Model as BaseModel; |
||
14 | use Illuminate\Database\Eloquent\SoftDeletes; |
||
15 | |||
16 | /** |
||
17 | * Token model. |
||
18 | */ |
||
19 | class Token extends BaseModel implements TokenInterface |
||
20 | { |
||
21 | use HasFactory, SoftDeletes, TokenUtilTrait; |
||
0 ignored issues
–
show
introduced
by
![]() |
|||
22 | |||
23 | /** |
||
24 | * The table associated with the model. |
||
25 | * |
||
26 | * @var string |
||
27 | */ |
||
28 | protected $table = 'mtn_momo_tokens'; |
||
29 | |||
30 | /** |
||
31 | * The attributes that are mass assignable. |
||
32 | * |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $fillable = [ |
||
36 | 'access_token', |
||
37 | 'refresh_token', |
||
38 | 'token_type', |
||
39 | 'product', |
||
40 | 'expires_at', |
||
41 | ]; |
||
42 | |||
43 | /** |
||
44 | * The attributes that should be mutated to dates. |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | protected $casts = [ |
||
49 | 'created_at' => 'datetime', |
||
50 | 'updated_at' => 'datetime', |
||
51 | 'expires_at' => 'datetime', |
||
52 | 'deleted_at' => 'datetime', |
||
53 | ]; |
||
54 | |||
55 | /** |
||
56 | * Create a new factory instance for the model. |
||
57 | * |
||
58 | * @return \Illuminate\Database\Eloquent\Factories\Factory |
||
59 | */ |
||
60 | 7 | public static function newFactory() |
|
61 | { |
||
62 | 7 | return TokenFactory::new(); |
|
63 | } |
||
64 | } |
||
65 |