| Total Complexity | 2 |
| Total Lines | 62 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class App extends Model |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * The database table used by the model. |
||
| 12 | * |
||
| 13 | * @var string |
||
| 14 | */ |
||
| 15 | protected $table = 'api_apps'; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * The primary key for the model. |
||
| 19 | * |
||
| 20 | * @var string |
||
| 21 | */ |
||
| 22 | protected $primaryKey = 'app_id'; |
||
| 23 | |||
| 24 | /** |
||
| 25 | * The "type" of the auto-incrementing ID. |
||
| 26 | * |
||
| 27 | * @var string |
||
| 28 | */ |
||
| 29 | protected $keyType = 'string'; |
||
| 30 | |||
| 31 | /** |
||
| 32 | * Indicates if the IDs are auto-incrementing. |
||
| 33 | * |
||
| 34 | * @var bool |
||
| 35 | */ |
||
| 36 | public $incrementing = false; |
||
| 37 | |||
| 38 | /** |
||
| 39 | * The guarded attributes on the model. |
||
| 40 | * |
||
| 41 | * @var array |
||
| 42 | */ |
||
| 43 | protected $guarded = []; |
||
| 44 | |||
| 45 | /** |
||
| 46 | * The attributes excluded from the model's JSON form. |
||
| 47 | * |
||
| 48 | * @var array |
||
| 49 | */ |
||
| 50 | protected $hidden = ['app_secret']; |
||
| 51 | |||
| 52 | /** |
||
| 53 | * Get the user that the token belongs to. |
||
| 54 | * |
||
| 55 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
| 56 | */ |
||
| 57 | public function user() |
||
| 58 | { |
||
| 59 | return $this->belongsTo(Api::$user, 'user_id'); |
||
| 60 | } |
||
| 61 | |||
| 62 | /** |
||
| 63 | * Get the app that the token belongs to. |
||
| 64 | * |
||
| 65 | * @return \Illuminate\Database\Eloquent\Relations\HasOne |
||
| 66 | */ |
||
| 67 | public function token() |
||
| 70 | } |
||
| 71 | } |
||
| 72 |