belongsTo(User::class, 'id_user'); } public function getEventsAttribute() { if (! $this->event_ids) { return collect(); } $ids = explode(';', $this->event_ids); return StressEvent::whereIn('id', $ids)->get(); } }