DatabaseSeeder.php 599 B

123456789101112131415161718192021222324
  1. <?php
  2. use Illuminate\Database\Seeder;
  3. class DatabaseSeeder extends Seeder
  4. {
  5. /**
  6. * Run the database seeds.
  7. *
  8. * @return void
  9. */
  10. public function run()
  11. {
  12. // 本地才允许 seed
  13. if (app()->isLocal()) {
  14. $this->call(UsersTableSeeder::class);
  15. $this->call(BlogCategorysTableSeeder::class);
  16. $this->call(BlogArticlesTableSeeder::class);
  17. $this->call(CourseBooksTableSeeder::class);
  18. $this->call(CourseSectionsTableSeeder::class);
  19. $this->call(CourseArticlesTableSeeder::class);
  20. }
  21. }
  22. }