3
0
mirror of https://github.com/snipe/snipe-it.git synced 2026-02-05 22:25:30 +00:00
Files
snipe-it/database/factories/LocationFactory.php
2025-11-17 11:18:02 +00:00

46 lines
1.2 KiB
PHP

<?php
namespace Database\Factories;
use Illuminate\Database\Eloquent\Factories\Factory;
class LocationFactory extends Factory
{
/**
* Define the model's default state.
*
* @return array
*/
public function definition()
{
return [
'name' => $this->faker->city(),
'address' => $this->faker->streetAddress(),
'address2' => $this->faker->secondaryAddress(),
'city' => $this->faker->city(),
'state' => $this->faker->stateAbbr(),
'country' => $this->faker->countryCode(),
'currency' => $this->faker->currencyCode(),
'zip' => $this->faker->postcode(),
'image' => rand(1, 9).'.jpg',
'notes' => 'Created by DB seeder',
'tag_color' => $this->faker->hexColor(),
];
}
// one of these can eventuall go away - left temporarily for conflict resolution
public function deleted(): self
{
return $this->state(['deleted_at' => $this->faker->dateTime()]);
}
public function deletedLocation()
{
return $this->state(function () {
return [
'deleted_at' => $this->faker->dateTime(),
];
});
}
}