Skip to content

Commit

Permalink
Merge pull request #203 from Laravel-Backpack/fix-controller-generati…
Browse files Browse the repository at this point in the history
…on-when-field-is-chosen-as-validation

fix controller generation when field is used as validation source
  • Loading branch information
pxpm authored Jan 30, 2024
2 parents 638244c + 107bdce commit aa90e14
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Console/Commands/CrudControllerBackpackCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class CrudControllerBackpackCommand extends BackpackCommand
{
use \Backpack\CRUD\app\Console\Commands\Traits\PrettyCommandOutput;
use \Backpack\Generators\Console\Commands\Traits\PublishableStubTrait;
use Traits\PublishableStubTrait;

/**
* The console command name.
Expand Down Expand Up @@ -223,7 +223,7 @@ protected function replaceRequest(&$stub)

// remove the validation class when validation is field
if ($validation === 'field') {
$stub = str_replace(" CRUD::setValidation(DummyClassRequest::class);\n\n", '', $stub);
$stub = str_replace(' CRUD::setValidation(DummyClassRequest::class);'.PHP_EOL, '', $stub);
}

return $this;
Expand Down

0 comments on commit aa90e14

Please sign in to comment.