argument('name'); $interfaceName = "{$name}RepositoryInterface"; $repositoryName = "{$name}Repository"; // Paths $interfacePath = app_path("Repositories/Contracts/{$interfaceName}.php"); $repositoryPath = app_path("Repositories/Eloquent/{$repositoryName}.php"); // Make directories if not exist if (!File::exists(app_path('Repositories/Contracts'))) { File::makeDirectory(app_path('Repositories/Contracts'), 0755, true); } if (!File::exists(app_path('Repositories/Eloquent'))) { File::makeDirectory(app_path('Repositories/Eloquent'), 0755, true); } // Interface stub $interfaceContent = "update(\$data); return \$model; } public function delete(\$id) { \$model = {$name}::findOrFail(\$id); return \$model->delete(); } }"; File::put($repositoryPath, $repositoryContent); $this->info("Repository & Interface for {$name} created successfully!"); } }