jeudi 17 octobre 2019

Laravel Call to undefined method Illuminate\Database\Query\Builder::updateOrInsert

I am trying to update a table or insert record if it doesn't exist. I am using laravel 5.1.46 I am using the below code

DB::table('abcd')->updateOrInsert(['entity_id' =>$params['id']], ['type' => 'reward_redeem','subject'=>$params['description'],'template'=>$params['email_template'],'is_active'=>1]);

It gives me error

BadMethodCallException in Builder.php line 2123: Call to undefined method Illuminate\Database\Query\Builder::updateOrInsert()

Whats wrong with it.Can someone pls help . I have the below in namespace as well.

use DB;


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/33Cy2Q3
via IFTTT

Aucun commentaire:

Enregistrer un commentaire