安装引导程序seeder

This commit is contained in:
TL 2022-08-25 16:14:37 +08:00
parent e1063eb3f2
commit fff09b9684
2 changed files with 94 additions and 2 deletions

File diff suppressed because one or more lines are too long

View File

@ -4,6 +4,7 @@ namespace Database\Seeders;
use Beike\Models\Product;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;
class DatabaseSeeder extends Seeder
{
@ -15,8 +16,12 @@ class DatabaseSeeder extends Seeder
*/
public function run()
{
// \App\Models\User::factory(10)->create();
// $this->duplicate();
// Eloquent::unguard();
$installerPath = base_path('beike/Installer');
$path = $installerPath . '/database.sql';
DB::unprepared(file_get_contents($path));
$this->command->info('Database seeded!');
}
/**