Initial Commit
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user