I need the main_issue from first iteration of array main_issue. Is there any other I can get main_issue from the array main_issue?
Thanks.
I tried <td>{{ $subIssue->main_issue->first()->main_issue }} </td>
getting an error "Trying to get property of non-object (View: "
Any help??
Here are the model & controller code.. public function SubIssue() { return $this->belongsTo('App\Models\Issues\SubIssue', 'main_issue_id','sub_issue_main_issue_id'); /**
Controller: $mainIssues = $mainIssue->where('main_issue_user_id', $id)->get(); return view('issues.mainIssues.mainIssues', compact('mainIssues')); }
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community