Closes Module 1: 9 auth endpoints under /api/v1/auth, OTP via SMS (Semaphore + log + fake drivers), role middleware, role + admin seeders, 27 feature tests passing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
31 lines
794 B
PHP
31 lines
794 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Seeder;
|
|
use Illuminate\Support\Facades\Hash;
|
|
|
|
class AdminUserSeeder extends Seeder
|
|
{
|
|
public function run(): void
|
|
{
|
|
$admin = User::firstOrCreate(
|
|
['email' => 'admin@verde.local'],
|
|
[
|
|
'phone' => '+639000000000',
|
|
'password' => Hash::make('password'),
|
|
'first_name' => 'Verde',
|
|
'last_name' => 'Admin',
|
|
'role' => User::ROLE_ADMIN,
|
|
'status' => User::STATUS_ACTIVE,
|
|
'email_verified_at' => now(),
|
|
'phone_verified_at' => now(),
|
|
'preferred_language' => 'en',
|
|
],
|
|
);
|
|
|
|
$admin->syncRoles([User::ROLE_ADMIN]);
|
|
}
|
|
}
|