dimanche 4 octobre 2015

Laravel Column Manually Added Cannot be Updated

So I have been searching but I couldn't find the correct answer to this.

I have an existing User table and added a birthdate column via SQL. The column value is being retrieved through user->birthdate but I cannot seem to save the values when i assign them. Is there anything I need to update on Laravel side?

I already tried recreating the model through artisan make:model User

I can assign other values and they are being saved except for the newly added column

$user = User::find($id);
$user->birthdate = $birthdate;  //NOT BEING SAVED
$user->name = $name;   //VALUE IS BEING SAVED
$user->save();

Retrieving is no problem

$user = User::find($id);
echo $user->birthdate; // Echoes successfully

Any help would be greatly appreciated



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire