All individual subscriptions are 50% off this week only!

kundefine
4 months ago

How can i sort storage file

Posted 4 months ago by kundefine

I want to sort all the files by 'created date'

Storage::disk('media')->allfiles(); 

// return array of all my filenames

/*[
     "golf-ba-ckg-ro-u-nd-1.jpg",
     "golf-ba-ckg-ro-u-nd-2.jpg",
     "golf-ba-ckg-ro-u-nd.jpg",
     "image-1-3.jpg",
     "image-10.jpg",
     "image-2-2.jpg",
     "image-3-2.jpg",
     "image-5-2.jpg",
     "image-6-2.jpg",
     "image4-1.jpg",
     "image4.jpg",
     "malaysia--ringgit--banknotes--falls-on-black-background-4k-clip-normal-speed_n1glvblm-l__f0000.png",
     "old-grunge-cement-wall-backgrounds_34552-195.jpg",
     "screenshot-1.jpg",
     "screenshot-2.jpg",
     "screenshot.jpg",
     "slider-1.jpg",
     "slider-logo-1.png",
     "slider-logo.png",
   ] */



Please sign in or create an account to participate in this conversation.