Drop Tables, Types and Views using Wipe Artisan Command in Laravel

By Hardik Savani November 5, 2023 Category : Laravel

Hi Artisan,

In this example, you will learn laravel migration drop all tables. We will use laravel drop all tables. I would like to share with you laravel drop list all tables. you will learn how to drop all tables in laravel.

Laravel Artisan provides wipe command to remove all tables from database. you can use wipe artisan command to drop tables, types and views. so, let's see the following wipe command syntax and example to remove all tables from laravel.

Syntax:

You can see the following syntax for wipe command:

php artisan db:wipe {--database=} {--drop-views} {--drop-types} {--force}

Below is the explanation of what the each options will do.

database - The database connection to use

drop-views - Drop all tables and views

drop-types - Drop all tables and types (Postgres only)

force - Force the operation to run when in production

Example:

You can see the following example for wipe command:

php artisan db:wipe

Output:

You will see the output.

I hope it can help you...

Shares