jeudi 10 janvier 2019

How can i search fetch all data from 3 tables and show it in my view in laravel?

I have 3 tables School,School details, and admission , and i am saving school id of school in school details & admission table with other information. Now i want to get all schools list that i am saving in all 3 tables. I am able to find data of two table school and admission not of school details table.

public function schoolslist($class='', $city='') {

    $schools = Admission::whereHas('school', function($query) use($city) { 
      $query->where('city', 'like', $city);})->where('admission_classes', $class)->where('status', '1')->orderBy('id','desc')->paginate(10);

      return view('frontend.schoollist',compact('schools'));

    }



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire