Support the ongoing development of Laravel.io →
Eloquent Laravel Database
Last updated 3 months ago.
0

So I got an answer over on Laracasts and I'd thought I'd post it here in case anybody is searching.

$store = Store::with('shirts', 'jackets')->find($id);

$sortedInventory =  $store
	->shirts
	->merge($store->jackets)
	->sortBy(['pivot.inventory_date'], 'ASC');
0

Sign in to participate in this thread!

LoadForge

Your banner here too?

Willis Willis willis1776 Joined 26 May 2021

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2022 Laravel.io - All rights reserved.