28 lines
632 B
PHP
28 lines
632 B
PHP
<?php
|
|
|
|
namespace Database\Seeders;
|
|
|
|
use App\Models\Building;
|
|
use App\Models\Room;
|
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
|
use Illuminate\Database\Seeder;
|
|
|
|
class RoomSeeder extends Seeder
|
|
{
|
|
/**
|
|
* Run the database seeds.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function run()
|
|
{
|
|
$items = [
|
|
['building_id' => Building::where('name','=','Bygning 7')->first()->id,'name' => '7X1'],
|
|
['building_id' => Building::where('name','=','Bygning 8')->first()->id,'name' => '8X1'],
|
|
];
|
|
foreach ($items as $item) {
|
|
Room::create($item);
|
|
}
|
|
}
|
|
}
|