You can use the DB :: operator. http://laravel.com/docs/database
DB::statement('INSERT INTO comments (comments) values (?)', array('LOL'));
You can add DUPLICATE KEY UPDATE there.
Unfortunately, there is no way to do this (which I know) with eloquent unless you do something like
$user = User::find(1); if ($user === null) { $user = new User; } $user->name = 'hey'; $user->save();
Aktee source share