A
A
Arteaga712015-08-08 17:00:31
Laravel
Arteaga71, 2015-08-08 17:00:31

Why is update not working in laravel 5?

Good afternoon, I understand with Laravel 5, but there was a problem when updating records in the database. Tried both the update and save methods, the error is the same: "Call to undefined method Illuminate\Database\Eloquent\Collection::update()", what could be the problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
J
JhaoDa, 2015-08-08
@Arteaga71

Because the collection does not have an update() method.
You probably received data using the all() or get() methods. You need to take any model from the result-collection and update() it already.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question