Answers for "delete multiple rows at once laravel"

2

delete multiple row in laravel

DB::table('users')->delete();

DB::table('users')->where('votes', '>', 100)->delete();
Posted by: Guest on July-15-2021
1

delete multiple row by model in laravel

public function destroy($id)
{
    if (is_array($id)) 
    {
        Product::destroy($id);
    }
    else
    {
        Product::findOrFail($id)->delete();
    }
    // redirect or whatever...
}
Posted by: Guest on August-07-2021

Code answers related to "delete multiple rows at once laravel"

Browse Popular Code Answers by Language