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

Размер файла: 866B
  1. <?php
  2.  
  3. declare(strict_types=1);
  4.  
  5. namespace App\Models;
  6.  
  7. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  8.  
  9. /**
  10. * Class Chat
  11. *
  12. * @property int id
  13. * @property int user_id
  14. * @property string text
  15. * @property string ip
  16. * @property string brow
  17. * @property int created_at
  18. * @property int edit_user_id
  19. * @property int updated_at
  20. */
  21. class Chat 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 BelongsTo
  41. */
  42. public function editUser(): BelongsTo
  43. {
  44. return $this->belongsTo(User::class, 'edit_user_id')->withDefault();
  45. }
  46. }