protected $appends = [ 'records' ];
public function getRecordsAttribute()
{
return $this->records();
}
public function records(){
return $this->hasMany(MeetingContentRecording::class, 'event_id','event_id');
}
Modelim bu şekilde ancak modeli basarken records attrübutes boş olarak geliyor. Halbuki içerisinde kayıt bulunmaktadır. Nasıl düzeltmeliyim ?
- event_id string olarak kaydedilmektedir. Foreign key atanmamıştır.