belykia
130
5
Laravel

why error message even with nullable laravel 5.6 ?

Posted 1 year ago by belykia

hello everybody :

i have 5 fields in a form that i created , but i got an error , even when i wrote 'nullable' in the controller for some fields that their not important to write :

     $ASNumber = $request->input('ASNumber');
      $request->validate([
'ASNumber' => 'required|unique:posts|max:255',
'choice' => 'nullable|max:255',
    'peeringDB' => 'nullable|max:255',
'asset' => 'nullable|max:255',

'Contact' => 'required|email', ]);

when i fill only the important fields , i got this error message :

SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'peeringdb' cannot be null (SQL: insert into posts (asnumber, peeringrs, peeringdb, asset, contact, updated_at, created_at) values (dfsadf, Yes, , , [email protected], 2018-05-21 15:43:00, 2018-05-21 15:43:00))

how is it possible ??

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.