mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Use DNS Location Record for Location * . * . * . * grammar fix * dns class * code changes * composer update * add missing composer.lock update * reposition Location record parsing * composer update * default yes ; change lookup order * merge master * . * move Location Record Parser to Model Level * . * fix location record code * Location precedence with tests Setting from UI disables all lookups * update composer.lock and mix-manifest.json * Style fixes Co-authored-by: Tony Murray <murraytony@gmail.com>
47 lines
1.0 KiB
PHP
47 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace Database\Factories;
|
|
|
|
use App\Models\Location;
|
|
use Illuminate\Database\Eloquent\Factories\Factory;
|
|
|
|
class LocationFactory extends Factory
|
|
{
|
|
/**
|
|
* The name of the factory's corresponding model.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $model = Location::class;
|
|
|
|
/**
|
|
* Define the model's default state.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function definition()
|
|
{
|
|
return [
|
|
'location' => $this->faker->randomElement([
|
|
$this->faker->sentence($this->faker->numberBetween(1, 10)),
|
|
str_replace("\n", ' ', $this->faker->address),
|
|
]),
|
|
];
|
|
}
|
|
|
|
/**
|
|
* Indicate add lat,lng
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Factories\Factory
|
|
*/
|
|
public function withCoordinates()
|
|
{
|
|
return $this->state(function (array $attributes) {
|
|
return [
|
|
'lat' => $this->faker->latitude,
|
|
'lng' => $this->faker->longitude,
|
|
];
|
|
});
|
|
}
|
|
}
|