| Total Complexity | 2 |
| Total Lines | 41 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 8 | class AccessToken extends Model |
||
| 9 | { |
||
| 10 | use AuthorizedActions; |
||
| 11 | |||
| 12 | protected $actions = ['viewAny', 'view', 'create', 'update', 'delete']; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * The attributes that are mass assignable. |
||
| 16 | * |
||
| 17 | * @var array |
||
| 18 | */ |
||
| 19 | protected $fillable = ['name', 'token', 'permissions']; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * The attributes that should be hidden for serialization. |
||
| 23 | * |
||
| 24 | * @var array |
||
| 25 | */ |
||
| 26 | protected $hidden = [ |
||
| 27 | 'token', |
||
| 28 | ]; |
||
| 29 | |||
| 30 | /** |
||
| 31 | * The attributes that should be cast. |
||
| 32 | * |
||
| 33 | * @var array |
||
| 34 | */ |
||
| 35 | protected $casts = [ |
||
| 36 | 'user_id' => 'integer', |
||
| 37 | 'permissions' => 'array', |
||
| 38 | 'last_used_at' => 'datetime', |
||
| 39 | ]; |
||
| 40 | |||
| 41 | 5 | public function user() |
|
| 44 | } |
||
| 45 | |||
| 46 | 4 | public static function findToken($token) |
|
| 51 |