vendredi 1 décembre 2017

Laravel Eloquent cannot assign a value to the model's relation property

I am unable to assign a value to a model's property

App\person::find(1)->plan

This command gives me something like this in artisan tinker

     id: 1,
     name: "name",
     description:"",

I am trying to specify a value for description

App\person::find(1)->plan->description='something'

It outputs

'something'

But it's not saving it in the description, I still get this

     id: 1,
     name: "name",
     description:"",

I tried several commands, none work

App\person::find(1)->plan->description='something'->save();
App\person::find(1)->plan->description->save('something');

Am I doing it wrong? Yes, the model's property has been set to fillable



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2BF1YxU
via IFTTT

Aucun commentaire:

Enregistrer un commentaire