first commit

This commit is contained in:
Noor E Ilahi
2026-01-09 12:54:53 +05:30
commit 7ccf44f7da
1070 changed files with 113036 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
<?php
namespace Database\Factories;
use App\Enums\Role;
use App\Enums\ScreenshotsState;
use Illuminate\Database\Eloquent\Factories\Factory;
class UserFactory extends Factory
{
public function definition(): array
{
return [
'full_name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'url' => '',
'company_id' => 1,
'avatar' => '',
'screenshots_state' => ScreenshotsState::REQUIRED,
'manual_time' => 0,
'computer_time_popup' => 300,
'blur_screenshots' => 0,
'web_and_app_monitoring' => 1,
'screenshots_interval' => 5,
'active' => 1,
'password' => 'password',
'user_language' => 'en',
'role_id' => Role::USER,
'type' => 'employee',
'last_activity' => now()->subMinutes(random_int(1, 55)),
];
}
public function admin(): UserFactory
{
return $this->state(fn () => ['role_id' => Role::ADMIN]);
}
public function manager(): UserFactory
{
return $this->state(fn () => ['role_id' => Role::MANAGER]);
}
public function auditor(): UserFactory
{
return $this->state(fn () => ['role_id' => Role::AUDITOR]);
}
}