| 1 | <?php |
||
| 8 | class Comment extends Model |
||
| 9 | { |
||
| 10 | use Countable; |
||
| 11 | |||
| 12 | /** |
||
| 13 | * The attributes that are mass assignable. |
||
| 14 | * |
||
| 15 | * @var array |
||
| 16 | */ |
||
| 17 | protected $fillable = [ |
||
| 18 | 'article_id', |
||
| 19 | 'user_id', |
||
| 20 | 'content' |
||
| 21 | ]; |
||
| 22 | |||
| 23 | /** |
||
| 24 | * Return the count cache configuration. |
||
| 25 | * |
||
| 26 | * @return array |
||
| 27 | */ |
||
| 28 | public function countCaches(): array |
||
| 35 | |||
| 36 | /** |
||
| 37 | * Get the user that owns the comment. |
||
| 38 | * |
||
| 39 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
| 40 | */ |
||
| 41 | public function user() |
||
| 45 | |||
| 46 | /** |
||
| 47 | * Get the article that owns the comment. |
||
| 48 | * |
||
| 49 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
| 50 | */ |
||
| 51 | public function article() |
||
| 55 | } |
||
| 56 |