I am using version control for my project. After some updates and commit when I run my project again, I have observed that laravel is truncating my Category table.
There are two ways to seed table.
-
DatabaseSeeder
and withphp artisan db:seed
and - Specific table seeder class by using
php artisan db:seed --class="CategoriesTableSeeder"
I am not able to catch behavior when its truncating my table.
I have tested it by commenting all line in the public function run(){}
inside DatabaseSeeder
class and also by commenting DB::table('categories')->insert($categories);
and DB::table('categories')->truncate();
in CategoriesTableSeeder
class.
Because table is getting truncated automatically, I have to seed it again and again.
Any idea???