You can try this code:
public function updateOrCreate(array $attributes, array $values = []) { return tap($this->firstOrNew($attributes), function ($instance) use ($values) { $instance->fill($values)->save(); }); }
By:Xtreem Solution
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community