first commit

This commit is contained in:
2026-10-09 08:21:06 +02:00
parent db7456df87
commit d259c62304
3761 changed files with 896046 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
namespace Database\Factories;
use App\Models\Country;
use Illuminate\Database\Eloquent\Factories\Factory;
class CountryFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Country::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'country_code' => $this->faker->countryCode,
'iso_3166_2' => strtoupper($this->faker->randomLetter.$this->faker->randomLetter),
'iso_3166_3' => $this->faker->countryISOAlpha3,
'name' => $this->faker->country,
'region_code' => 123,
'sub_region_code' => 123,
];
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use App\Models\Permission;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class PermissionFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Permission::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => Str::random(5),
'display_name' => implode(' ', $this->faker->words(2)),
'description' => substr($this->faker->paragraph, 0, 191),
'removable' => true,
];
}
}
+32
View File
@@ -0,0 +1,32 @@
<?php
namespace Database\Factories;
use App\Models\Role;
use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
class RoleFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Role::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => Str::random(5),
'display_name' => implode(' ', $this->faker->words(2)),
'description' => $this->faker->sentence,
'removable' => true,
];
}
}
+44
View File
@@ -0,0 +1,44 @@
<?php
namespace Database\Factories;
use App\Models\Country;
use App\Models\Role;
use App\Models\User;
use App\Support\Enum\UserStatus;
use Illuminate\Database\Eloquent\Factories\Factory;
class UserFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = User::class;
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'email' => $this->faker->email,
'password' => '$2y$10$A2A/2IIP.jsLzIiAPr.enuzxzRWzIzLWifqNU33PWPBGx6mkJFz72', // 123123123
'first_name' => $this->faker->firstName,
'last_name' => $this->faker->lastName,
'phone' => $this->faker->phoneNumber,
'avatar' => null,
'address' => $this->faker->address,
'country_id' => function () {
return $this->faker->randomElement(Country::pluck('id')->toArray());
},
'role_id' => Role::factory(),
'status' => UserStatus::ACTIVE,
'birthday' => $this->faker->date(),
'email_verified_at' => (string) now(),
];
}
}