mercredi 28 novembre 2018

How to create eloquent relationship for this query?

I had a query in laravel which producing 1128 data lists:

 $itemregistrations = DB::table('itemregistrations')
                     ->join('sections', 'itemregistrations.sectionid', '=', 'sections.sectionid')
                     ->join('categories', 'itemregistrations.categoryid', '=', 'categories.categoryid')
                     ->join('operasi', 'itemregistrations.operasiid', '=', 'operasi.operasiid')
                     ->select('itemregistrations.ItemRegistrationID','itemregistrations.name', 'itemregistrations.Nobadan', 'sections.sectionname', 'categories.categoryname', 'operasi.operasiname')
                     ->get();

However, this query loads takes longer time...so is using eloquent relationship will help to speed the loading time? How to connect them using relationship?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire