Test Failed
Push — master ( 65b1e6...cf15ae )
by Stephen
02:23
created

AddressFactory::definition()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 9

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 9
nc 1
nop 0
dl 0
loc 11
rs 9.9666
c 1
b 0
f 0
1
<?php
2
3
namespace Database\Factories;
4
5
use Illuminate\Database\Eloquent\Factories\Factory;
6
use Sfneal\Address\Models\Address;
7
use Sfneal\Address\Tests\Models\People;
8
9
class AddressFactory extends Factory
10
{
11
    /**
12
     * The name of the factory's corresponding model.
13
     *
14
     * @var string
15
     */
16
    protected $model = Address::class;
17
18
    /**
19
     * Define the model's default state.
20
     *
21
     * @return array
22
     */
23
    public function definition(): array
24
    {
25
        return [
26
            'type' => $this->faker->randomElement(['home', 'work', 'business']),
27
            'address_1' => $this->faker->streetAddress,
28
            'address_2' => $this->faker->secondaryAddress,
29
            'city' => $this->faker->city,
30
            'state' => $this->faker->state,
31
            'zip' => $this->faker->postcode,
32
            'addressable_id' => People::factory(),
33
            'addressable_type' => People::class,
34
        ];
35
    }
36
}
37