Created
August 13, 2017 12:52
-
-
Save zgabievi/8df0d433e7b943e30529f96ee76468b8 to your computer and use it in GitHub Desktop.
FOREIGN_KEY problem in DatabaseSeeder solved!
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 | |
use Illuminate\Database\Seeder; | |
class DatabaseSeeder extends Seeder | |
{ | |
/** | |
* Run the database seeds. | |
* | |
* @return void | |
*/ | |
public function run() | |
{ | |
Eloquent::unguard(); | |
DB::statement('SET FOREIGN_KEY_CHECKS = 0;'); | |
// $this->call(UsersTableSeeder::class); | |
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