diff --git a/src/Prettus/Repository/Generators/ModelGenerator.php b/src/Prettus/Repository/Generators/ModelGenerator.php index 7eb65bc2..0d427700 100644 --- a/src/Prettus/Repository/Generators/ModelGenerator.php +++ b/src/Prettus/Repository/Generators/ModelGenerator.php @@ -78,13 +78,15 @@ public function getReplacements() */ public function getFillable() { + $this->fillable = $this->options['fillable']; + if (!$this->fillable) { return '[]'; } $results = '[' . PHP_EOL; - foreach ($this->getSchemaParser()->toArray() as $column => $value) { - $results .= "\t\t'{$column}'," . PHP_EOL; + foreach ($this->getSchemaParser() as $value) { + $results .= "\t\t'{$value}'," . PHP_EOL; } return $results . "\t" . ']'; @@ -97,6 +99,6 @@ public function getFillable() */ public function getSchemaParser() { - return new SchemaParser($this->fillable); + return explode(',', str_replace(' ', '', $this->fillable)); } }