| 1 | <?php |
||
| 18 | class AchievementModel extends Model |
||
| 19 | { |
||
| 20 | /** |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | protected $table = 'achievements'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @var array |
||
| 27 | */ |
||
| 28 | protected $fillable = [ |
||
| 29 | 'name', 'description', 'points', |
||
| 30 | ]; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @var array |
||
| 34 | */ |
||
| 35 | protected $casts = [ |
||
| 36 | 'points' => 'integer', |
||
| 37 | ]; |
||
| 38 | |||
| 39 | /** |
||
| 40 | * Criterias list. |
||
| 41 | * |
||
| 42 | * @return \Illuminate\Database\Eloquent\Relations\HasMany |
||
| 43 | */ |
||
| 44 | public function criterias() |
||
| 48 | |||
| 49 | /** |
||
| 50 | * Determines if achievement was completed. |
||
| 51 | * This works only in user-related achievements lists. |
||
| 52 | * |
||
| 53 | * @return bool |
||
| 54 | */ |
||
| 55 | public function completed(): bool |
||
| 59 | } |
||
| 60 |