Просмотр файла 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. * Morph name
  39. *
  40. * @var string
  41. */
  42. public static $morphName = 'comments';
  43.  
  44. /**
  45. * Возвращает связанные объекты
  46. *
  47. * @return MorphTo
  48. */
  49. public function relate(): MorphTo
  50. {
  51. return $this->morphTo('relate');
  52. }
  53. }