Laravel 5: return number of affected rows MySQL
Did you try?
Official manual: The delete method should be used to delete records from the database. Like update, the number of rows deleted will be returned:
$deleted = DB::delete('delete from users');
For update()
and delete()
calls, the return value is the number of affected rows.
$affected = DB::delete("DELETE FROM chat WHERE id = {$mid}");