Is there any way I can mass replace a column value ?
I am currently using the where clause but it returns an object.
I want to replace it iteratively if there isn't a replace-all function?
DB::table('users')
->where('votes', 1)
->update(array('votes' => 10));
Using eloquent:
User::where('votes', 1)->update(array('votes' => 10));
I guess the field should be in the fillable array of your model
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community