| 1 | <?php |
||
| 11 | class UserBadge extends ChocolateyModel |
||
| 12 | { |
||
| 13 | use Eloquence, Mappable; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Disable Timestamps. |
||
| 17 | * |
||
| 18 | * @var bool |
||
| 19 | */ |
||
| 20 | public $timestamps = false; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * The table associated with the model. |
||
| 24 | * |
||
| 25 | * @var string |
||
| 26 | */ |
||
| 27 | protected $table = 'users_badges'; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * Primary Key of the Table. |
||
| 31 | * |
||
| 32 | * @var string |
||
| 33 | */ |
||
| 34 | protected $primaryKey = 'id'; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * The attributes that will be mapped. |
||
| 38 | * |
||
| 39 | * @var array |
||
| 40 | */ |
||
| 41 | protected $maps = ['badgeIndex' => 'slot_id', 'code' => 'badge_code', 'name' => 'badge_code']; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * The attributes excluded from the model's JSON form. |
||
| 45 | * |
||
| 46 | * @var array |
||
| 47 | */ |
||
| 48 | protected $hidden = ['user_id', 'badge_code', 'slot_id', 'id']; |
||
| 49 | |||
| 50 | /** |
||
| 51 | * The Appender(s) of the Model. |
||
| 52 | * |
||
| 53 | * @var array |
||
| 54 | */ |
||
| 55 | protected $appends = ['description', 'badgeIndex', 'code', 'name']; |
||
| 56 | |||
| 57 | /** |
||
| 58 | * Get Description Attribute. |
||
| 59 | * |
||
| 60 | * @return string |
||
| 61 | */ |
||
| 62 | public function getDescriptionAttribute(): string |
||
| 66 | } |
||
| 67 |