Level 16
@raviawasti Please write it properly. I get nothing out of it.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have subject table
Id =2 name:science
And i have Openings table where i save id =1 subject_id=2 title=science teacher job
$jobsdata = Openings::where('status',1)->orderBy('end_date','desc')->select('id','subject_id','title')->get();
I have set Relationship in Openings model
public function Subject() { return $this->belongsTo('App\Subject','subject'); }
I am getting data in view when i use relationship but, i want to know
How can i send science for subject_id field instead for id 2 from subject table in $jobsdata variable:-
Please or to participate in this conversation.