LAR_Maintenance/database/seeders/DatabaseSeeder.php

30 lines
648 B
PHP
Raw 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();
2024-08-06 14:20:45 +00:00
if (empty(User::where('email', 'test@example.co')->first())){
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
]);
}
}