I have two types of queries with me,
$quotations = Quotation::join('clients as c', 'c.id', '=', 'client_id')
->with("client", "items", "salesPerson")
->orderBy('quotation_date', 'desc')
->paginate(5);
and
$quotations = Quotation::with("items","salesPerson","client")->paginate(100)
In first case,result not including "clients","items" and "salespPerson".
but in second case,result includes all above item.
Is there any error in my approach?
I can not use second one because id doesn't support orderby with related model. When I am using first one,Related objects are NULL.