Ekapp/skolehjem/database/seeds/LocationSeeder.php

32 lines
539 B
PHP

<?php
use Illuminate\Database\Seeder;
class LocationSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$locationdata = [
[
"name" => "Bygning B"
],
[
"name" => "Bygning E"
]
];
foreach ($locationdata as $data) {
$location = new \App\Location();
$location->name = $data["name"];
$location->save();
}
}
}