'Нет', self::NOTIFICATION_RESPONSIBLES => 'Админы, менеджер, бригадир', self::NOTIFICATION_ALL => 'Все', self::NOTIFICATION_USER => 'Конкретному пользователю', ]; protected $fillable = [ 'order_id', 'reclamation_id', 'user_id', 'target_user_id', 'notification_type', 'message', ]; public function order(): BelongsTo { return $this->belongsTo(Order::class); } public function reclamation(): BelongsTo { return $this->belongsTo(Reclamation::class); } public function user(): BelongsTo { return $this->belongsTo(User::class); } public function targetUser(): BelongsTo { return $this->belongsTo(User::class, 'target_user_id'); } public function notifiedUsers(): BelongsToMany { return $this->belongsToMany(User::class, 'chat_message_user'); } public function files(): BelongsToMany { return $this->belongsToMany(File::class, 'chat_message_file')->withTimestamps(); } }