Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
milwad-dev committed Jan 26, 2025
1 parent b5a3ab5 commit 0466e30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Commands/Modules/MakeCrudModuleCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
Expand Down
7 changes: 7 additions & 0 deletions tests/Commands/Modules/MakeCrudModuleCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Milwad\LaravelCrod\Tests\Commands\Modules;

use Illuminate\Support\Facades\File;
use Milwad\LaravelCrod\Tests\TestCase;

class MakeCrudModuleCommandTest extends TestCase
Expand Down Expand Up @@ -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'));
}

/**
Expand Down

0 comments on commit 0466e30

Please sign in to comment.