public function AjaxStore(Request $request) { $subject = ObjectFinder::GetObject($request->subject_type, $request->subject_id); $subject->RecordNewComment($request->comment); //get all the comments $comments = $subject->Comments; return view('Comments.partials.ajaxresponse', compact('comments')); }
/** * @param $subjectType * @param $subjectId * * override of the base class method * * @return mixed */ public function getBySubjectTypeAndID($subjectType, $subjectId) { //check if the parent has the meetings trait $parent = ObjectFinder::GetObject($subjectType, $subjectId); //$meetings = null; $meetings = []; //check if paret not found by the object finder if (!$parent) { return null; } if (in_array(MeetingTrait::class, class_uses($parent))) { //$meetings = $parent->Meetings->all(); $meetings = $parent->Meetings->lists('title', 'id'); //if (count($meetings) > 0) $meetings[-1] = 'Select a meeting'; //else // $meetings = null; return $meetings; } else { return null; } }