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

Размер файла: 910B
  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 Ignore
  11. *
  12. * @property int id
  13. * @property int user_id
  14. * @property int ignore_id
  15. * @property string text
  16. * @property int created_at
  17. */
  18. class Ignore extends BaseModel
  19. {
  20. /**
  21. * The table associated with the model.
  22. *
  23. * @var string
  24. */
  25. protected $table = 'ignoring';
  26.  
  27. /**
  28. * Indicates if the model should be timestamped.
  29. *
  30. * @var bool
  31. */
  32. public $timestamps = false;
  33.  
  34. /**
  35. * The attributes that aren't mass assignable.
  36. *
  37. * @var array
  38. */
  39. protected $guarded = [];
  40.  
  41. /**
  42. * Возвращает связь пользователей
  43. *
  44. * @return BelongsTo
  45. */
  46. public function ignoring(): BelongsTo
  47. {
  48. return $this->belongsTo(User::class, 'ignore_id')->withDefault();
  49. }
  50. }