38 lines
887 B
PHP
Executable file
38 lines
887 B
PHP
Executable file
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Category;
|
|
use App\Models\Program;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
// use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Seed the application's database.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
// User::factory(10)->create();
|
|
|
|
User::factory()->create([
|
|
'name' => 'Marley',
|
|
'email' => 'e@m.ail',
|
|
'password' => 'password',
|
|
]);
|
|
|
|
Category::factory(20)
|
|
->has(Program::factory()->count(3))
|
|
->has(Program::factory()->trashed()->count(1))
|
|
->create();
|
|
|
|
Category::factory(10)
|
|
->has(Program::factory()->count(1))
|
|
->has(Program::factory()->trashed()->count(1))
|
|
->trashed()
|
|
->create();
|
|
}
|
|
}
|