Reputation: 12005
I have this query:
$result = Transaction::with("items", "results")->get();
How return data from Transactions
only when exist data in relation results
?
Upvotes: 0
Views: 49
Reputation: 301
You may use has method
$result = Transaction::has('results')->with("items", "results")->get();
Upvotes: 4