37 lines
937 B
PHP
37 lines
937 B
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Stabile;
|
|
use App\Models\Amministratore;
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
/**
|
|
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\App\Models\Stabile>
|
|
*/
|
|
class StabileFactory extends Factory
|
|
{
|
|
protected $model = Stabile::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function definition(): array
|
|
{
|
|
return [
|
|
'amministratore_id' => function () {
|
|
return Amministratore::factory()->create()->id;
|
|
},
|
|
'codice_stabile' => strtoupper(bin2hex(random_bytes(4))),
|
|
'denominazione' => $this->faker->company(),
|
|
'indirizzo' => $this->faker->streetAddress(),
|
|
'cap' => '00100',
|
|
'citta' => $this->faker->city(),
|
|
'provincia' => 'RM',
|
|
];
|
|
}
|
|
}
|