Skip to content

Commit aa90e14

Browse files
authored
Merge pull request #203 from Laravel-Backpack/fix-controller-generation-when-field-is-chosen-as-validation
fix controller generation when field is used as validation source
2 parents 638244c + 107bdce commit aa90e14

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Console/Commands/CrudControllerBackpackCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
class CrudControllerBackpackCommand extends BackpackCommand
99
{
1010
use \Backpack\CRUD\app\Console\Commands\Traits\PrettyCommandOutput;
11-
use \Backpack\Generators\Console\Commands\Traits\PublishableStubTrait;
11+
use Traits\PublishableStubTrait;
1212

1313
/**
1414
* The console command name.
@@ -223,7 +223,7 @@ protected function replaceRequest(&$stub)
223223

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

229229
return $this;

0 commit comments

Comments
 (0)