Skip to content

A free open source IT asset/license management system

1.0 KB
Raw Blame
<?php

namespace Database\Factories;

use App\Models\User;
use Illuminate\Database\Eloquent\Factories\Factory;

class LocationFactory extends Factory
{
    /**
     * Define the model's default state.
     *
     * @return array
     */
    public function definition()
    {
        return [
            'address' => $this->faker->streetAddress(),
            'address2' => $this->faker->secondaryAddress(),
            'city' => $this->faker->city(),
            'country' => $this->faker->countryCode(),
            'created_by' => User::factory()->superuser(),
            'currency' => $this->faker->currencyCode(),
            'image' => rand(1, 9).'.jpg',
            'name' => $this->faker->unique()->city(),
            'notes' => 'Created by DB seeder',
            'state' => $this->faker->stateAbbr(),
            'tag_color' => $this->faker->hexColor(),
            'zip' => $this->faker->postcode(),
        ];
    }

    public function deleted(): self
    {
        return $this->state(['deleted_at' => $this->faker->dateTime()]);
    }
}