Sorry I should have explained clearly... Here is an example:
class SubIssue extends Eloquent { public function issueTracker() { return $this->belongsTo('App\Models\Issues\IssueTracker', 'issue_tracking_sub_issue_id', 'sub_issue_id'); }
class IssueTracker extends Eloquent { public function subIssue() { return $this->hasOne('App\Models\Issues\SubIssue', 'sub_issue_id', 'issue_tracking_sub_issue_id'); }
$data = $issueTracker->where('issue_tracking_user_id', $id) ->with('subIssue') ->get();
In the $data collection I am getting "sub_issue" as array instead of "SubIssue".
Thanks for your time.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community