Hi I've search and try to solve the issue but failed to grab solution sorry for taking your time. I am inserting a set of data in laravel with the query builder to insert multiple data at a time.
DB::table('table')->insert(
array(
array(
'col1' => 'data1',
'col2' => 'data1'
),
array(
'col1' => 'data2',
'col2' => 'data2'
),
)
);
Is there any way to check if exist the col1,col2
value in table if exist then update otherwise insert. I wanted to get return true
or false
from the query result if all data successfully update or inserted. I wanted to solve it with laravel query builder.
Thanks