argument('disk') ?: config('filesystems.default'); $path = 'healthcheck/' . now()->format('YmdHis') . '-' . uniqid() . '.txt'; $this->line('default=' . config('filesystems.default')); $this->line('disk=' . $disk); $this->line('endpoint=' . (config("filesystems.disks.{$disk}.endpoint") ?: '-')); $this->line('url=' . (config("filesystems.disks.{$disk}.url") ?: '-')); $this->line('bucket=' . (config("filesystems.disks.{$disk}.bucket") ?: '-')); $this->line('path_style=' . json_encode(config("filesystems.disks.{$disk}.use_path_style_endpoint"))); try { $stored = Storage::disk($disk)->put($path, 'ok'); if (!$stored) { $this->error("put=false path={$path}"); return self::FAILURE; } $exists = Storage::disk($disk)->exists($path); $this->line('put=ok'); $this->line('exists=' . ($exists ? 'yes' : 'no')); $this->line('public_url=' . Storage::disk($disk)->url($path)); Storage::disk($disk)->delete($path); $this->line('delete=ok'); } catch (Throwable $e) { $this->error(get_class($e) . ': ' . $e->getMessage()); return self::FAILURE; } return self::SUCCESS; } }