mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-26 22:19:41 -08:00
44 lines
1.1 KiB
PHP
44 lines
1.1 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',
|
|
];
|
|
}
|
|
|
|
// 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(),
|
|
];
|
|
});
|
|
}
|
|
}
|