Skip to content

Commit

Permalink
fix filter namespace, register command
Browse files Browse the repository at this point in the history
  • Loading branch information
axyr committed Aug 14, 2024
1 parent 3091348 commit 9e96cf6
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions resources/stubs/Filter.stub
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace {{namespace}};

use Axyr\CrudGenerator\Filters\ArrayFilters;
use Axyr\CrudGenerator\Filters\Contracts\SortableInterface;

Expand Down
2 changes: 1 addition & 1 deletion src/Commands/GenerateCrud.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace Commands;
namespace Axyr\CrudGenerator\Commands;

use Axyr\CrudGenerator\Generators\CombinedGenerator;
use Illuminate\Console\Command;
Expand Down
3 changes: 2 additions & 1 deletion src/CrudGeneratorServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Axyr\CrudGenerator;

use Axyr\CrudGenerator\Commands\GenerateCrud;
use Illuminate\Support\ServiceProvider;

class CrudGeneratorServiceProvider extends ServiceProvider
Expand All @@ -28,7 +29,7 @@ protected function bootCommands(): void
{
if ($this->app->runningInConsole()) {
$this->commands([

GenerateCrud::class,
]);
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/Generators/FilterGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public static function dataModelWriteTest(): array
'module' => 'Posts',
'expectedPath' => 'app/Modules/Posts/Filters/CommentFilter.php',
'expectedStrings' => [
'namespace App\Modules\Posts\Filters;',
'class CommentFilter',
],
],
Expand Down
3 changes: 2 additions & 1 deletion tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Axyr\CrudGenerator\CrudGeneratorServiceProvider;
use Carbon\Carbon;
use Illuminate\Support\Facades\File;
use Orchestra\Testbench\Concerns\WithWorkbench;

class TestCase extends \Orchestra\Testbench\TestCase
Expand All @@ -18,7 +19,7 @@ protected function setUp(): void
{
parent::setUp();

//File::deleteDirectory(base_path(config('crudgenerator.base_path')));
File::deleteDirectory(base_path(config('crudgenerator.base_path')));

Carbon::setTestNow($this->now = now());
}
Expand Down

0 comments on commit 9e96cf6

Please sign in to comment.