storage url o'zgartirildi

This commit is contained in:
2026-04-28 16:21:25 +05:00
parent 519f97debf
commit 285be8edea

View File

@@ -8,7 +8,9 @@ use Throwable;
class StorageHealthCheck extends Command
{
protected $signature = 'storage:health-check {disk? : Disk name, defaults to filesystems.default}';
protected $signature = 'storage:health-check
{disk? : Disk name, defaults to filesystems.default}
{--keep : Keep the test file so the public URL can be checked in a browser}';
protected $description = 'Check current storage disk, write/read/delete a test file, and print its public URL.';
@@ -37,8 +39,13 @@ class StorageHealthCheck extends Command
$this->line('exists=' . ($exists ? 'yes' : 'no'));
$this->line('public_url=' . Storage::disk($disk)->url($path));
Storage::disk($disk)->delete($path);
$this->line('delete=ok');
if ($this->option('keep')) {
$this->warn('delete=skipped');
$this->warn('Open public_url in browser or curl it from outside the container.');
} else {
Storage::disk($disk)->delete($path);
$this->line('delete=ok');
}
} catch (Throwable $e) {
$this->error(get_class($e) . ': ' . $e->getMessage());
return self::FAILURE;