0
현재 작업중인 프로젝트와의 관계를 설정하려고합니다. 내가 얻는 오류는 다음과 같습니다. MacroMagicCallException in Macroable.php 라인 81 : 메소드 조직이 존재하지 않습니다.MacroMore.php의 BadMethodCallException 81 :
여기 내 가게 방법입니다.
공공 기능 저장소는 내 CalendarEvent 모델 나의 관계는 내 조직 모델이
public function Organization()
{
return $this->belongsTo('App\Organization');
}
의 관계처럼 설정 (요청 $ 요청) {
$calendar_event = new CalendarEvent();
$calendar_event->title = $request->input("title");
$calendar_event->start = $request->input("start");
$calendar_event->end = $request->input("end");
$calendar_event->is_all_day = $request->input("is_all_day");
$calendar_event->background_color = $request->input("background_color");
$request->Organization()->calendar()->save($calendar_event);
return redirect()->route('calendar_events.index')->with('message', 'Item created successfully.');
}이 설정되어 이 같은
public function calendar()
{
return $this->hasMany('App\CalendarEvent');
}
도와 줘서 고마워.