jonnybarnes.uk/database/seeds/PlacesTableSeeder.php

27 lines
708 B
PHP
Raw Normal View History

2016-05-19 15:01:28 +01:00
<?php
use App\Place;
2016-05-19 15:01:28 +01:00
use Illuminate\Database\Seeder;
use Phaza\LaravelPostgis\Geometries\Point;
2016-05-19 15:01:28 +01:00
class PlacesTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$place = new Place();
$place->name = 'The Bridgewater Pub';
$place->description = 'A lovely local pub with a decent selection of cask ales';
$place->location = new Point('53.4983', '-2.3805');
$place->external_urls = json_encode([
'foursqaure' => 'https://foursqaure.com/v/123435/the-bridgewater-pub',
'osm' => 'https://www.openstreetmap.org/way/987654',
2016-05-19 15:01:28 +01:00
]);
$place->save();
2016-05-19 15:01:28 +01:00
}
}