48 lines
1.3 KiB
PHP
48 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\School;
|
|
use App\Models\Student;
|
|
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();
|
|
|
|
// User::factory()->create([
|
|
// 'name' => 'Test User',
|
|
// 'email' => 'test@example.com',
|
|
// ]);
|
|
|
|
$vinita = School::factory()->has(Student::factory()->count(38))->create([
|
|
'name' => 'Vinita',
|
|
'address' => '801 N. Adair St.',
|
|
'city' => 'Vinita',
|
|
'state' => 'OK',
|
|
'zip'=> '74301'
|
|
]);
|
|
|
|
$matt = User::factory()->create([
|
|
'school_id' => $vinita->id,
|
|
'first_name' => 'Matt',
|
|
'last_name' => 'Young',
|
|
'judging_preference' => 'Admin',
|
|
'cell_phone' => '918-994-2263',
|
|
'email' => 'youngma@vinitahornets.com',
|
|
'password' => '$2y$12$sBXf1PnwrLbFQBVxN934O.21jRrm8KVXTlOABxif48Dfbe3Fejv5a'
|
|
]);
|
|
|
|
School::factory()->has(Student::factory()->count(random_int(12,45)))->has(User::factory()->count(2))->count(30)->create();
|
|
|
|
|
|
}
|
|
}
|