Question:How can you update an existing record in laravel using a Model? 

A $row=new MyModel; $row->field1=’Field1 Value’ $row->save() 

B $row=new MyModel; $row->field1=’Field1 Value’ $row->insert() 

C $row=MyModel::find($id); $row->field1=’Field1 Value’ $row->create() 

D $row=new MyModel::find($id); $row->field1=’Field1 Value’ $row->save() 

+ Answer
+ Report
Total Preview: 906

Copyright © 2024. Powered by Intellect Software Ltd