for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
use Sfneal\Address\Models\Address;
use Sfneal\Address\Tests\Models\People;
class AddressFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
*/
protected $model = Address::class;
* Define the model's default state.
* @return array
public function definition(): array
return [
'type' => $this->faker->randomElement(['home', 'work', 'business']),
'address_1' => $this->faker->streetAddress,
'address_2' => $this->faker->secondaryAddress,
'city' => $this->faker->city,
'state' => $this->faker->state,
'zip' => $this->faker->postcode,
'addressable_id' => People::factory(),
'addressable_type' => People::class,
];
}