0
我想註冊一個沒有元數據的用戶。我有這樣的代碼,但這個使用laravel3 + sentry1創建/註冊用戶
$user = Sentry::user()->register(array(
'email' => Input::get('email'),
'password' => Input::get('password')
));
但後來我得到這個錯誤:
SQLSTATE[HY000]: General error: 1364 Field 'first_name' doesn't have a default value
SQL: INSERT INTO `users_metadata` (`user_id`) VALUES (?)
Bindings: array ( 0 => 1, )
我會很感激你的幫助。
嗨。感謝你的回答。你是對的。 first_name不允許空值,我知道爲什麼會拋出這個錯誤,但後來我問你:我必須根據我的應用程序需要更新/更改遷移嗎? – Ricbermo
如果你不想插入first_name的,你必須允許NULL,因此改變你的遷移,是的。 – aebersold