Permanently delete a record in laravel

Updated at 21-Sep-2021, By samar

Permanently delete a record in laravel

We will use programming in this lesson to attempt to solve the "Permanently delete a record in laravel".

You can permanently delete a record in laravel using forceDelete() method. If you want to delete the record after the soft delete then you can also use the forceDelete method.
  • ForceDelete() in laravel

    --PATH routes\web.php
    Route::get('/force-delete-user', function(){
        $user = App\Models\User::find(1);
        $deleteUser = $user->forceDelete();
        dd($deleteUser);
    });
    
    Output :
    ^ true
    forceDelete() method permanently deletes the records from the table.

Back to code snippet queries related laravel