Просмотр файла app/Models/Comment.php

Размер файла: 929B
  1. <?php
  2.  
  3. declare(strict_types=1);
  4.  
  5. namespace App\Models;
  6.  
  7. use Illuminate\Database\Eloquent\Relations\MorphTo;
  8.  
  9. /**
  10. * Class Comment
  11. *
  12. * @property int id
  13. * @property int user_id
  14. * @property string relate_type
  15. * @property int relate_id
  16. * @property string text
  17. * @property string ip
  18. * @property string brow
  19. * @property int created_at
  20. */
  21. class Comment extends BaseModel
  22. {
  23. /**
  24. * Indicates if the model should be timestamped.
  25. *
  26. * @var bool
  27. */
  28. public $timestamps = false;
  29.  
  30. /**
  31. * The attributes that aren't mass assignable.
  32. *
  33. * @var array
  34. */
  35. protected $guarded = [];
  36.  
  37. /**
  38. * Возвращает связанные объекты
  39. *
  40. * @return MorphTo
  41. */
  42. public function relate(): MorphTo
  43. {
  44. return $this->morphTo('relate');
  45. }
  46.  
  47. /**
  48. * Morph name
  49. *
  50. * @var string
  51. */
  52. public static $morphName = 'comments';
  53. }