option('group'), $this->option('url') ? url($this->option('url')) : null); if ($this->option('except') && ! $this->option('only')) { $ziggy->filter(explode(',', $this->option('except')), false); } else if ($this->option('only') && ! $this->option('except')) { $ziggy->filter(explode(',', $this->option('only'))); } $path = $this->argument('path') ?? config('ziggy.output.path', 'resources/js/ziggy.js'); if ($filesystem->isDirectory(base_path($path))) { $path .= '/ziggy'; } else { $filesystem->ensureDirectoryExists(dirname(base_path($path)), recursive: true); } $name = preg_replace('/(\.d)?\.ts$|\.js$/', '', $path); if (! $this->option('types-only')) { $output = config('ziggy.output.file', File::class); $filesystem->put(base_path("{$name}.js"), new $output($ziggy)); } if ($this->option('types') || $this->option('types-only')) { $types = config('ziggy.output.types', Types::class); $filesystem->put(base_path("{$name}.d.ts"), new $types($ziggy)); } $this->info('Files generated!'); } }