Support the ongoing development of →
Eloquent Laravel Database
Last updated 2 years ago.

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
	->sortBy(['pivot.inventory_date'], 'ASC');

Sign in to participate in this thread!


Your banner here too?

Willis willis1776 Joined 26 May 2021


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.

© 2024 - All rights reserved.