Skip to content

Commit 0f20b67

Browse files
committed
[EH] change placeholder
1 parent 50e1429 commit 0f20b67

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Services/BackpackCrudModelService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ private function fillFillableAttributeInGeneratedModelFromSchema()
3636
$modelFile = end($this->command->filesToBeOpened);
3737

3838
$model = $this->filesystem->get($modelFile);
39-
$model = str_replace('\'schemafields\'', $this->getFillableFromSchema(), $model);
39+
$model = str_replace('__fillable__', $this->getFillableFromSchema(), $model);
4040
$this->filesystem->put($modelFile, $model);
4141
}
4242

@@ -46,7 +46,7 @@ private function fillFillableAttributeInGeneratedModelFromSchema()
4646
private function getFillableFromSchema()
4747
{
4848
$this->command->schema->getStructure()->each(function ($field) {
49-
$this->fillable .= '\'' . $field->getName() . '\',';
49+
$this->fillable .= "'" . $field->getName() . "',\n";
5050
});
5151

5252
return $this->fillable;

stubs/crud-model.stub

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class DummyClass extends Model
1919
// protected $primaryKey = 'id';
2020
// public $timestamps = false;
2121
// protected $guarded = ['id'];
22-
protected $fillable = ['schemafields'];
22+
protected $fillable = [__fillable__];
2323
// protected $hidden = [];
2424
// protected $dates = [];
2525

0 commit comments

Comments
 (0)