Search
 
SCRIPT & CODE EXAMPLE
 

PHP

php artisan drop table

php artisan make:migration drop_name_table
Comment

laravel drop table column

Update Table

migrate:fresh          Drop all tables and re-run all migrations
migrate:install        Create the migration repository
migrate:refresh        Reset and re-run all migrations
migrate:reset          Rollback all database migrations
migrate:rollback       Rollback the last database migration
migrate:status         Show the status of each migration

for specific table
php artisan migrate:refresh --path=/database/migrations/table_name.php
Comment

laravel drop table migration

Schema::drop('users');

Schema::dropIfExists('users');
Comment

laravel db drop table

//Get all the table names
$all_table_names = Schema::getConnection()->getDoctrineSchemaManager()->listTableNames();

foreach ($all_table_names as $name) {
    //if you don't want to truncate migrations in Database
    if ($name == 'migrations') {
        continue;
    }
    DB::table($name)->truncate();
}
Comment

laravel db drop table

foreach(DB::select('SHOW TABLES') as $table) {
    $all_table_names = get_object_vars($table);
    Schema::drop($all_table_names[key($all_table_names)]);
}
Comment

PREVIOUS NEXT
Code Example
Php :: how to delete all data from table in php 
Php :: wordpress wp_enqueue_script footer 
Php :: php check if function exists 
Php :: remove first character from string laravel 
Php :: php capitalize each word 
Php :: php get object keys 
Php :: laravel validation max string length 
Php :: laravel limit query pagination 
Php :: php session working on localhost but not on hosting server 
Php :: convert object to array in php 
Php :: php get values that exist in both arrays 
Php :: php post 
Php :: Laravel Auth Redirect based on role 
Php :: ci db query error 
Php :: php check if date is bigger than today 
Php :: array_key_exists vs isset 
Php :: getclientoriginalextension laravel 
Php :: php connect to data base 
Php :: php compare two versions return true or false if version is big 
Php :: Session store not set on request. 
Php :: check if the form is submitted php 
Php :: Array and string offset access syntax with curly braces is deprecated in tcpdf.php 
Php :: php file for image load 
Php :: php 2d empty array remove 
Php :: composer update withou memory limit 
Php :: random integer php 
Php :: php syntax 
Php :: laravel get subdomain 
Php :: how to add recaptcha validation in php 
Php :: validation not exists with this id laravel 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =