getTenants(); try { if ($this->option('remove')) { $this->removeLinks($tenants); } else { $this->createLinks($tenants); } } catch (Exception $exception) { $this->components->error($exception->getMessage()); return 1; } return 0; } /** * @param LazyCollection $tenants */ protected function removeLinks(LazyCollection $tenants): void { (new RemoveStorageSymlinksAction)($tenants); $this->components->info('The links have been removed.'); } /** * @param LazyCollection $tenants */ protected function createLinks(LazyCollection $tenants): void { (new CreateStorageSymlinksAction)( $tenants, (bool) ($this->option('relative') ?? false), (bool) ($this->option('force') ?? false), ); $this->components->info('The links have been created.'); } }