I don't understand why performInsert() deletes my '_logo' field in Laravel 5.2. My model has everything fillable except for 'id', 'created_at' and 'updated_at'.
(2/2) QueryException
SQLSTATE[HY000]: General error: 1364 Field '_logo' doesn't have a default value (SQL: insert into `LC_portatori` (`nome`, `cognome`, `tipo`, `pwd`, `telefono`, `indirizzo`, `email`, `updated_at`, `created_at`) values (Nome, CognomE, TipO, PwD, TelefonO, IndirizzO, emaiL, 2017-06-30 11:37:52, 2017-06-30 11:37:52))
in Connection.php (line 647)
at Connection->runQueryCallback('insert into `LC_portatori` (`nome`, `cognome`, `tipo`, `pwd`, `telefono`, `indirizzo`, `email`, `updated_at`, `created_at`) values (?, ?, ?, ?, ?, ?, ?, ?, ?)', array('Nome', 'CognomE', 'TipO', 'PwD', 'TelefonO', 'IndirizzO', 'emaiL', '2017-06-30 11:37:52', '2017-06-30 11:37:52'), object(Closure))
in Connection.php (line 607)
at Connection->run('insert into `LC_portatori` (`nome`, `cognome`, `tipo`, `pwd`, `telefono`, `indirizzo`, `email`, `updated_at`, `created_at`) values (?, ?, ?, ?, ?, ?, ?, ?, ?)', array('Nome', 'CognomE', 'TipO', 'PwD', 'TelefonO', 'IndirizzO', 'emaiL', '2017-06-30 11:37:52', '2017-06-30 11:37:52'), object(Closure))
in Connection.php (line 450)
at Connection->statement('insert into `LC_portatori` (`nome`, `cognome`, `tipo`, `pwd`, `telefono`, `indirizzo`, `email`, `updated_at`, `created_at`) values (?, ?, ?, ?, ?, ?, ?, ?, ?)', array('Nome', 'CognomE', 'TipO', 'PwD', 'TelefonO', 'IndirizzO', 'emaiL', '2017-06-30 11:37:52', '2017-06-30 11:37:52'))
in Connection.php (line 404)
at Connection->insert('insert into `LC_portatori` (`nome`, `cognome`, `tipo`, `pwd`, `telefono`, `indirizzo`, `email`, `updated_at`, `created_at`) values (?, ?, ?, ?, ?, ?, ?, ?, ?)', array('Nome', 'CognomE', 'TipO', 'PwD', 'TelefonO', 'IndirizzO', 'emaiL', '2017-06-30 11:37:52', '2017-06-30 11:37:52'))
in Processor.php (line 32)
at Processor->processInsertGetId(object(Builder), 'insert into `LC_portatori` (`nome`, `cognome`, `tipo`, `pwd`, `telefono`, `indirizzo`, `email`, `updated_at`, `created_at`) values (?, ?, ?, ?, ?, ?, ?, ?, ?)', array('Nome', 'CognomE', 'TipO', 'PwD', 'TelefonO', 'IndirizzO', 'emaiL', '2017-06-30 11:37:52', '2017-06-30 11:37:52'), 'id')
in Builder.php (line 2138)
at Builder->insertGetId(array('Nome', 'CognomE', 'TipO', 'PwD', 'TelefonO', 'IndirizzO', 'emaiL', '2017-06-30 11:37:52', '2017-06-30 11:37:52'), 'id')
in Builder.php (line 1247)
at Builder->__call('insertGetId', array(array('nome' => 'Nome', 'cognome' => 'CognomE', 'tipo' => 'TipO', 'pwd' => 'PwD', 'telefono' => 'TelefonO', 'indirizzo' => 'IndirizzO', 'email' => 'emaiL', 'updated_at' => '2017-06-30 11:37:52', 'created_at' => '2017-06-30 11:37:52'), 'id'))
in Model.php (line 684)
at Model->insertAndSetId(object(Builder), array('nome' => 'Nome', 'cognome' => 'CognomE', 'tipo' => 'TipO', 'pwd' => 'PwD', 'telefono' => 'TelefonO', 'indirizzo' => 'IndirizzO', 'email' => 'emaiL', 'updated_at' => '2017-06-30 11:37:52', 'created_at' => '2017-06-30 11:37:52'))
in Model.php (line 649)
at Model->performInsert(object(Builder))
in Model.php (line 518)
at Model->save()
in Builder.php (line 734)
at Builder->Illuminate\Database\Eloquent\{closure}(object(Portatore))
in helpers.php (line 936)
at tap(object(Portatore), object(Closure))
in Builder.php (line 735)
at Builder->create(array('nome' => 'Nome', 'cognome' => 'CognomE', 'tipo' => 'TipO', 'pwd' => 'PwD', 'telefono' => 'TelefonO', 'indirizzo' => 'IndirizzO', 'email' => 'emaiL', '_logo' => 'nonceproprio'))
in Model.php (line 1357)
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire