remove compose file to another repo
This commit is contained in:
33
database/factories/UserFactory.php
Normal file
33
database/factories/UserFactory.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\Province;
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
/**
|
||||
* @extends Factory<User>
|
||||
*/
|
||||
class UserFactory extends Factory
|
||||
{
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'full_name' => $this->faker->name(),
|
||||
'username' => $this->faker->userName(),
|
||||
'position' => $this->faker->randomElement(['boss', 'operator']),
|
||||
'gender' => $this->faker->randomElement(['female', 'male']),
|
||||
'national_id' => $this->faker->unique()->numerify('##########'),
|
||||
'phone_number' => '09' . $this->faker->unique()->randomNumber(9, true),
|
||||
'province_id' => Province::factory(),
|
||||
'province_fa' => function (array $attributes) {
|
||||
return Province::query()->find($attributes['province_id'])->name;
|
||||
},
|
||||
'password' => Hash::make('password'),
|
||||
'email' => $this->faker->email,
|
||||
'telephone_id' => $this->faker->unique()->numerify('tel-####')
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user