How to use update query in laravel?



How to use update query in laravel?..

Answer / Sana Parveen

To perform an update query, you should use the update() method and provide an array of column names and their corresponding values. Here's an example:n```phpnUser::where('id', $userId)->update(['name' => $newName]);n```

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Laravel PHP Framework Interview Questions

How to install laravel via composer?

1 Answers  


What are the available router methods?

1 Answers  


Is laravel object oriented?

1 Answers  


How to configure a mail-in laravel?

1 Answers  


What do you know about facades in laravel? Explain.

1 Answers  


Which template engine is used by laravel?

1 Answers  


What is the directory structure of laravel 5.6?

1 Answers  


What do you know about closures in laravel?

1 Answers  


What are the software’s included in laravel homestead?

1 Answers  


What is localization?

1 Answers  


In laravel, what is fillable attribute in a model?

1 Answers  


What are the advanced features of laravel 6.0?

1 Answers  


Categories