Init(Core): add to repo and add seeders

This commit is contained in:
2026-04-28 22:48:42 +03:30
commit be6b699ff0
205 changed files with 22524 additions and 0 deletions

View File

@@ -0,0 +1,56 @@
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
/**
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\User>
*/
class UserFactory extends Factory
{
/**
* The current password being used by the factory.
*/
protected static ?string $password = null;
/**
* Define the model's default state.
*
* @return array<string, mixed>
*/
public function definition(): array
{
return [
'name' => fake()->name(),
'email' => fake()->unique()->safeEmail(),
'password' => static::$password ??= Hash::make('password'),
'token' => bin2hex(random_bytes(32)),
'remember_token' => Str::random(10),
];
}
/**
* Indicate that the user is an admin.
*/
public function admin(): static
{
return $this->state(fn (array $attributes) => [
'name' => 'Admin User',
'email' => 'admin@example.com',
]);
}
/**
* Indicate that the user is a test user.
*/
public function test(): static
{
return $this->state(fn (array $attributes) => [
'name' => 'Test User',
'email' => 'test@example.com',
]);
}
}