Laravel-admin: Custom field in Form

Created on 17 Apr 2017  ·  3Comments  ·  Source: z-song/laravel-admin

I want to add a custom select input for a column that doesn't exist in my model.

My Model ist something like this

MyModel.php
id
name

but in create form want to to show a select('template') so that I can do some extra steps after saving the model.

I have now error Column not found: 1054 Unknown column 'xxx' in 'field list' when submit the form.
Anyone knows how to archive this?

Most helpful comment

Use $form->ignore(['column']); to ignore columns that doesn't exist in table.

All 3 comments

Use $form->ignore(['column']); to ignore columns that doesn't exist in table.

@z-song yes, I know I can do it, but then I can't access the value of that field in my callback anymore, I created a pull request to solve my problem, hope you have time to take a look: https://github.com/z-song/laravel-admin/pull/765

Merged, Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vlongen picture vlongen  ·  3Comments

benny-sun picture benny-sun  ·  3Comments

MarKco picture MarKco  ·  3Comments

evans-kim picture evans-kim  ·  3Comments

amun1303 picture amun1303  ·  3Comments