How to put a field in other table?

Posted 8 months ago by irankhosravi

Look at my codes.


$requisitions = Requisition::with('schools')->where('city_id', auth()->user()->city_id)->latest()->paginate(25);


public function schools ()
    return $this->belongsTo(SchoolsList::class, 'school_id');

I have two tables schools and requisitions in my project.

schools table

id, province_id, city_id, gender,......

requisitions table

id, school_id, type, ...

How to put schools in RequisitionController

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.