sleeping-owl / admin

Administrative interface builder for Laravel
http://sleeping-owl.github.io/
MIT License
504 stars 259 forks source link

An incrementing int in db instead of the real form data passed when creating new model item #279

Open idanpt opened 8 years ago

idanpt commented 8 years ago

hi, i have this on my model, which extends SleepingOwlModel:

protected $fillable = ['name'];

in the model config i have this:

Admin::model(App\Models\Category::class) ->title('Category') ->columns(function () { Column::string('name', 'Name'); Column::string('creator_id', 'Creator id'); Column::string('updater_id', 'updater id'); Column::string('created_at', 'Created at'); }) ->form(function () { FormItem::text('name', 'Name') ->required() ->unique(); });

when i try to save a new item for this model, the 'name' field is field with an auto incrementing int, instead of the value i pass in the form field. anything im missing?

idanpt commented 8 years ago

forgot to mention - this is happening only on inserting a new row. when i edit - name field is saved with the real value i pass