mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Use DNS Location Record for Location (#12409)
* 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>
This commit is contained in:
46
database/factories/LocationFactory.php
Normal file
46
database/factories/LocationFactory.php
Normal file
@@ -0,0 +1,46 @@
|
||||
<?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,
|
||||
];
|
||||
});
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user