I have following model structure in a Laravel app and I need to access the user via company as shown
I have tried the hasOneThrough method but later understood its not working for this structure
my plan is using something similar to bellow within item controller
$item->whereHas('user', function ($query) use ($filters) {
// this sell_diamonds represents the model Item::sell_diamonds
$query->where('status', 'A');
});
Please suggest me the best method to achieve this goal. Many thanks
via Chebli Mohamed

Aucun commentaire:
Enregistrer un commentaire