A simple helpdesk tickets system for Laravel 5.1+ which integrates smoothly with Laravel default users and auth system, demo is available at: http://ticketit.kordy.info/tickets
MIT License
875
stars
387
forks
source link
Getting an error when trying to create a new input field on create ticket #548
I have a very complicated problem here. I followed the tutorial on the issue #454.
Publish views so you can edit the html layout of the form: php artisan vendor:publish
Publishing the view and adding the new input field was easy, here is what i added:
{!! CollectiveForm::text('address', null, ['class' => 'form-control', 'required' => 'required']) !!}
Create a migration that extends the table ticketit with fields you want.
And on phpmyadmin, i made this:
And it has its own index too, just like the "subject" one.
Override TicketsController so that in the store method you can add the functionality to store extra fields. This is how to override a vendor class (read the comments too): https://stackoverflow.com/a/34600074
I created the overrides folder and added the "autoload" thing into composer.json
Now for the problem im having:
When i try to submit the new ticket, i get this error:
SQLSTATE[HY000]: General error: 1364 Field 'address' doesn't have a default value (SQL: insert into ticketit (subject, content, html, priority_id, category_id, status_id, user_id, agent_id, updated_at, created_at) values (TEST SUBJECT, TEST DESC,
I have a very complicated problem here. I followed the tutorial on the issue #454.
Publishing the view and adding the new input field was easy, here is what i added:
{!! CollectiveForm::text('address', null, ['class' => 'form-control', 'required' => 'required']) !!}
And on phpmyadmin, i made this: And it has its own index too, just like the "subject" one.
I created the overrides folder and added the "autoload" thing into composer.json
Now for the problem im having:
When i try to submit the new ticket, i get this error: SQLSTATE[HY000]: General error: 1364 Field 'address' doesn't have a default value (SQL: insert into
ticketit
(subject
,content
,html
,priority_id
,category_id
,status_id
,user_id
,agent_id
,updated_at
,created_at
) values (TEST SUBJECT, TEST DESC,TEST DESC
, 1, 1, 1, 1, 1, 2020-01-29 19:01:41, 2020-01-29 19:01:41))And if i add a default value to "address" on phpmyadmin, or if i make it nullable, it will be an empty field or the default value i set.
Basically, the "address" data is not being sent to the database, and i have no idea why.