ItSolutionStuff.com

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

By Hardik Savani • November 5, 2023
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...

Hardik Savani

Hardik Savani

I'm a full-stack developer, entrepreneur, and founder of ItSolutionStuff.com. Passionate about PHP, Laravel, JavaScript, and helping developers grow.

📺 Subscribe on YouTube

We Are Recommending You

How to Drop Index in Laravel Migration?

Read Now →

How to Drop Unique Constraint in Laravel Migration?

Read Now →

Laravel Migration Unique Multiple Columns Example

Read Now →

Laravel Migration Change Datatype Timestamp to Datetime Example

Read Now →

Laravel Migration Change Datatype Date to Datetime Example

Read Now →

Laravel Migration Change Default Value Example

Read Now →

Laravel Migration Change Datatype String to Integer Example

Read Now →

Laravel Migration Change Datatype Varchar to Text Example

Read Now →

Laravel Migration Add Column After Column Example

Read Now →

Laravel Migration Default Value Current Timestamp Example

Read Now →

How to Update Enum Value in Laravel Migration?

Read Now →

Laravel Migration - How to Add New Column in Existing Table ?

Read Now →

How to Change Table Name using Laravel Migration?

Read Now →

How to Remove Column from Table in Laravel Migration?

Read Now →