debug: also list storage/app/public contents
This commit is contained in:
@@ -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,
|
||||
]);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user