tmp/my_folder 内で 1日以上経過したテンポラリファイルを削除する
// 1日経過したテンポラリファイルを削除
collect(\Storage::disk('local')->listContents('tmp/my_folder', true))
->each(function($file) {
if ($file['type'] == 'file' && $file['timestamp'] < now()->subDays(1)->getTimestamp()) {
// dd( "{$file['path']} を削除する" , \Storage::disk('local')->path($file['path']) );
\Storage::disk('local')->delete($file['path']);
}
});