mercredi 29 novembre 2017

How to use where with Laravel Eloquent Model

I am attempting to

 $orders = \App\Order::with(['Customer'])->where('customers.first', 'LIKE', "{$filterFirst}%");

However, I am getting

 Column not found: 1054 Unknown column 'customers.first' in 'where clause' (SQL: select * from `orders` where `customers`.`first` LIKE %)

How can I use where as well as with?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire