LAR_Maintenance/database/seeders/DatabaseSeeder.php

30 lines
649 B
PHP
Raw Permalink Normal View History

2024-07-30 08:44:45 +00:00
<?php
namespace Database\Seeders;
use App\Models\User;
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
/**
* Seed the application's database.
*/
public function run(): void
{
// User::factory(10)->create();
if (empty(User::where('email', 'test@example.com')->first())){
2024-08-06 14:20:45 +00:00
User::factory()->create([
'name' => 'Test User',
'email' => 'test@example.com',
]);
}
2024-07-30 08:44:45 +00:00
2024-08-06 14:20:45 +00:00
$this->call([
HostSeeder::class,
TaskSeeder::class,
2024-07-30 08:44:45 +00:00
]);
}
}