diff --git a/routes/web.php b/routes/web.php index 2bda3a7..0722ab7 100644 --- a/routes/web.php +++ b/routes/web.php @@ -58,6 +58,21 @@ Route::get('/debug-storage', function () { $latestMedia = \DB::table('media')->latest('id')->first(); + // List contents of /app/storage/app/public + $contents = []; + if (is_dir($storageAppPublic)) { + foreach (scandir($storageAppPublic) as $item) { + if (in_array($item, ['.', '..'])) continue; + $full = $storageAppPublic . '/' . $item; + if (is_dir($full)) { + $sub = array_values(array_diff(scandir($full), ['.', '..'])); + $contents[$item . '/'] = $sub; + } else { + $contents[] = $item . ' (' . filesize($full) . 'b)'; + } + } + } + return response()->json([ 'public_storage' => [ 'path' => $publicStoragePath, @@ -83,6 +98,7 @@ Route::get('/debug-storage', function () { ] : null, 'media_disk_config' => config('media-library.disk_name'), 'app_url' => config('app.url'), + 'storage_listing' => $contents, ]); });