Created
February 19, 2018 12:20
-
-
Save ooooak/71fd0a710f12d9125834c01f5ee0d46c to your computer and use it in GitHub Desktop.
[laravel] Truncate tables with foreign key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
\DB::statement('SET FOREIGN_KEY_CHECKS=0'); | |
App\Product::truncate(); | |
App\ProductCategory::truncate(); | |
App\ProductBrand::truncate(); | |
App\Attribute::truncate(); | |
App\Review::truncate(); | |
\DB::statement('SET FOREIGN_KEY_CHECKS=1'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment