Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to truncate all tables laravel

foreach ($tableNames as $name) {
    //if you don't want to truncate migrations
    if ($name == 'migrations') {
        continue;
    }
    DB::table($name)->truncate();
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #truncate #tables #laravel
ADD COMMENT
Topic
Name
6+5 =