| Conditions | 5 |
| Paths | 29 |
| Total Lines | 19 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 31 | public function handle(): void |
||
| 32 | { |
||
| 33 | /** |
||
| 34 | * @var Client $cup |
||
| 35 | */ |
||
| 36 | $cup = app(CupKitServiceProvider::SINGLETON_CLIENT); |
||
| 37 | foreach (config('corundum.buckets', []) as $bucketName => $views) { |
||
| 38 | try { |
||
| 39 | $cup->createBucket($bucketName); |
||
| 40 | $this->info("Bucket $bucketName create"); |
||
| 41 | } catch (\Throwable $throwable) { |
||
| 42 | $this->warn("Bucket $bucketName exists"); |
||
| 43 | } finally { |
||
| 44 | foreach ($views as $view) { |
||
| 45 | try { |
||
| 46 | $cup->createView($bucketName, $view); |
||
| 47 | $this->info("View $bucketName.{$view['name']} create"); |
||
| 48 | } catch (\Throwable $throwable) { |
||
| 49 | $this->warn("View $bucketName.{$view['name']} exists"); |
||
| 50 | } |
||
| 57 |