diff --git a/src/Commands/Modules/MakeCrudModuleCommand.php b/src/Commands/Modules/MakeCrudModuleCommand.php index d74dcdf..b068b70 100644 --- a/src/Commands/Modules/MakeCrudModuleCommand.php +++ b/src/Commands/Modules/MakeCrudModuleCommand.php @@ -164,7 +164,7 @@ protected function makeRequest(string $name) */ protected function makeView(string $name): void { - $viewPath = config('laravel-crod.modules.view_path', 'Resources/Views'); + $viewPath = config('laravel-crod.modules.view_path', 'Resources\Views'); $pathSource = $this->getDestPath($name, $viewPath); // Index @@ -175,14 +175,14 @@ protected function makeView(string $name): void ->generate(); // Create - LaravelStub::from(realpath(__DIR__.'/../../Stubs/module/request.stub')) + LaravelStub::from(realpath(__DIR__.'/../../Stubs/module/blade.stub')) ->to($pathSource) ->name('create') ->ext('blade.php') ->generate(); // Edit - LaravelStub::from(realpath(__DIR__.'/../../Stubs/module/request.stub')) + LaravelStub::from(realpath(__DIR__.'/../../Stubs/module/blade.stub')) ->to($pathSource) ->name('edit') ->ext('blade.php') diff --git a/tests/Commands/Modules/MakeCrudModuleCommandTest.php b/tests/Commands/Modules/MakeCrudModuleCommandTest.php index e9a3307..62876a6 100644 --- a/tests/Commands/Modules/MakeCrudModuleCommandTest.php +++ b/tests/Commands/Modules/MakeCrudModuleCommandTest.php @@ -2,6 +2,7 @@ namespace Milwad\LaravelCrod\Tests\Commands\Modules; +use Illuminate\Support\Facades\File; use Milwad\LaravelCrod\Tests\TestCase; class MakeCrudModuleCommandTest extends TestCase @@ -195,6 +196,12 @@ protected function ensureCrudFileCreated(): void $this->assertFileExists(base_path('Modules/Product/Resources/Views/index.blade.php')); $this->assertFileExists(base_path('Modules/Product/Resources/Views/create.blade.php')); $this->assertFileExists(base_path('Modules/Product/Resources/Views/edit.blade.php')); + + // Ensure provide exists + $this->assertFileExists(base_path('Modules/Product/Providers/ProductServiceProvider.php')); + + // Ensure route exists + $this->assertFileExists(base_path('Modules/Product/Routes/web.php')); } /**