rewrite proses harim
This commit is contained in:
55
database/factories/HarimFactory.php
Normal file
55
database/factories/HarimFactory.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Factories;
|
||||
|
||||
use App\Models\City;
|
||||
use App\Models\EdarateShahri;
|
||||
use App\Models\HarimState;
|
||||
use App\Models\Province;
|
||||
use Illuminate\Database\Eloquent\Factories\Factory;
|
||||
|
||||
/**
|
||||
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Harim>
|
||||
*/
|
||||
class HarimFactory extends Factory
|
||||
{
|
||||
/**
|
||||
* Define the model's default state.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function definition(): array
|
||||
{
|
||||
return [
|
||||
'state_id' => $this->faker->numberBetween(1,5),
|
||||
'state_name' => function (array $attributes) {
|
||||
return HarimState::query()->find($attributes['state_id'])->name;
|
||||
},
|
||||
'first_name' => $this->faker->firstName(),
|
||||
'last_name' => $this->faker->lastName(),
|
||||
'phone_number' => $this->faker->numerify('09#########'),
|
||||
'request_number' => $this->faker->numerify(),
|
||||
'request_date' => $this->faker->date(),
|
||||
'province_id' => Province::factory(),
|
||||
'province_name' => function (array $attributes) {
|
||||
return Province::query()->find($attributes['province_id'])->name;
|
||||
},
|
||||
'city_id' => City::factory(),
|
||||
'city_name' => function (array $attributes) {
|
||||
return City::query()->find($attributes['city_id'])->name;
|
||||
},
|
||||
'edareh_shahri_id' => EdarateShahri::factory(),
|
||||
'county' => $this->faker->citySuffix,
|
||||
'division' => $this->faker->word,
|
||||
'village' => $this->faker->name,
|
||||
'grand_area' => $this->faker->numberBetween(1,100),
|
||||
'plan_area' => $this->faker->numberBetween(1,100),
|
||||
'requested_organization' => $this->faker->name,
|
||||
'plan_group' => $this->faker->name,
|
||||
'plan_title' => $this->faker->title,
|
||||
'address' => $this->faker->address,
|
||||
'file' => $this->faker->file,
|
||||
'polygon' => $this->faker->numerify(),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user