LoginSignup
1
0

More than 3 years have passed since last update.

51歳からのプログラム 備忘録 Data missing toArray()

Last updated at Posted at 2019-05-10

Data missing

$user=User::where('id',1)->first();
$user_array=$user->toArray();

$user_array=$user->toArray() のように、モデルを配列に置き換えた時に、Data missingエラーが出た。

色々と試したり確認していたら、users_tableの、created_atupdated_atのデータを削除してしまっていたことが原因のよう。

created_atやupdated_atのデータがないと、toArray()できないのかな?
とりあえず、備忘として。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0