argument("name"); $relativePath = config("lucent.image_filter_path"); $dir = base_path($relativePath); if (!is_dir($dir)) { mkdir($dir, 0755, true); } $className = Str::of($name)->camel()->ucfirst() . "ImageFilter"; $pathName = Str::of($name)->snake()->lower(); $filePath = "{$dir}/{$className}.php"; if (file_exists($filePath)) { $this->error("Filter {$name} already exists at {$filePath}"); return Command::FAILURE; } $namespace = str_replace("/", "\\", ucwords($relativePath, "/")); $stub = <<info("Created {$filePath}"); return Command::SUCCESS; } }