Drop Tables, Types and Views using Wipe Artisan Command in 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
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- How to Drop Index in Laravel Migration?
- How to Drop Unique Constraint in Laravel Migration?
- Laravel Migration Unique Multiple Columns Example
- Laravel Migration Change Datatype Timestamp to Datetime Example
- Laravel Migration Change Datatype Date to Datetime Example
- Laravel Migration Change Default Value Example
- Laravel Migration Change Datatype String to Integer Example
- Laravel Migration Change Datatype Varchar to Text Example
- Laravel Migration Add Column After Column Example
- Laravel Migration Default Value Current Timestamp Example
- How to Update Enum Value in Laravel Migration?
- Laravel Migration - How to Add New Column in Existing Table ?
- How to Change Table Name using Laravel Migration?
- How to Remove Column from Table in Laravel Migration?