Answers for "delete recoreds usign table in laravel"

PHP
1

how delete the table in laravel in the commend

php artisan migrate:reset
Posted by: Guest on April-10-2021
1

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();
}
Posted by: Guest on January-08-2022

Code answers related to "delete recoreds usign table in laravel"

Browse Popular Code Answers by Language