58 lines
1.6 KiB
PHP
58 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class DatabaseSeeder extends Seeder
|
|
{
|
|
use WithoutModelEvents;
|
|
|
|
/**
|
|
* Seed the application's database.
|
|
*/
|
|
public function run(): void
|
|
{
|
|
// Owner User
|
|
\App\Models\User::updateOrCreate(
|
|
['email' => 'owner@gympro.com'],
|
|
[
|
|
'name' => 'Gym Owner',
|
|
'password' => \Illuminate\Support\Facades\Hash::make('password'),
|
|
'role' => 'owner'
|
|
]
|
|
);
|
|
|
|
// Single Branch
|
|
$branch = \App\Models\Branch::updateOrCreate(
|
|
['name' => 'Main Branch'],
|
|
[
|
|
'location' => 'City Center',
|
|
'manager_name' => 'Manager Name',
|
|
'total_members' => 0,
|
|
'revenue' => 0.00,
|
|
'status' => 'Active',
|
|
'operational_start_date' => now()->format('Y-m-d'),
|
|
]
|
|
);
|
|
|
|
// Sample Receptionist
|
|
\App\Models\Receptionist::updateOrCreate(
|
|
['email' => 'reception@gympro.com'],
|
|
[
|
|
'branch_id' => $branch->id,
|
|
'name' => 'Main Receptionist',
|
|
'password' => 'password',
|
|
]
|
|
);
|
|
|
|
// Collection Types
|
|
$types = ['Registration', 'Monthly Fee', 'Product Sale', 'Personal Training', 'Other'];
|
|
foreach ($types as $type) {
|
|
\App\Models\CollectionType::updateOrCreate(['name' => $type]);
|
|
}
|
|
}
|
|
}
|