Closed ISNewton closed 4 months ago
Describe your task Hi there, How to disable the default where slug = default scope where eager loading the wallet :
$teachers = Teacher::query() ->with('wallet' ,function($query){ $query->select('balance' , 'meta'); }) ->whereHas('wallet' , function ($query) use ($request) { $query ->where('slug', Teacher::getInstitutionWalletKey($request->institution->id)); }) ->get() ;
This generates the following query:
"select * from `users` where exists (select * from `wallets` where `users`.`id` = `wallets`.`holder_id` and `wallets`.`holder_type` = ? and `slug` = ? and `slug` = ?)"
How to get rid of the extra where slug clause that comes with from the package?
This is solved by querying the wallets relation instead of wallet
wallets
wallet
Describe your task Hi there, How to disable the default where slug = default scope where eager loading the wallet :
This generates the following query:
How to get rid of the extra where slug clause that comes with from the package?