1 | <?php |
||
2 | |||
3 | namespace Database\Seeders; |
||
4 | |||
5 | use Illuminate\Database\Seeder; |
||
6 | use TestSetup\Models\House; |
||
7 | |||
8 | class HousesSeeder extends Seeder |
||
9 | { |
||
10 | /** |
||
11 | * Run the database Seeds. |
||
12 | * |
||
13 | * @return void |
||
14 | */ |
||
15 | public function run() |
||
16 | { |
||
17 | $houses = '[ |
||
18 | { |
||
19 | "_key": "lannister", |
||
20 | "name": "Lannister", |
||
21 | "location_id": "king-s-landing", |
||
22 | "led_by": "TywinLannister", |
||
23 | "en": { |
||
24 | "description": "House Lannister of Casterly Rock is one of the Great Houses of Westeros, one of its richest and most powerful families and one of its oldest dynasties. It was also the royal House of the Seven Kingdoms following the extinction of House Baratheon of King\'s Landing, which had been their puppet House during the War of the Five Kings, for a brief stint of time until House Targaryen took back the Iron Throne in Daenerys Targaryen\'s war for Westeros." |
||
25 | } |
||
26 | }, |
||
27 | { |
||
28 | "_key": "stark", |
||
29 | "name": "Stark", |
||
30 | "location_id": "winterfell", |
||
31 | "led_by": "NedStark", |
||
32 | "en": { |
||
33 | "description": "House Stark of Winterfell is a Great House of Westeros and the royal house of the Kingdom of the North. They rule over the vast region known as the North from their seat in Winterfell. It is one of the oldest lines of Westerosi nobility by far, claiming a line of descent stretching back over eight thousand years. Before the Targaryen conquest, as well as during the War of the Five Kings and early on in Daenerys Targaryen\'s war for Westeros, the leaders of House Stark ruled over the region as the Kings in the North." |
||
34 | } |
||
35 | }, |
||
36 | { |
||
37 | "_key": "targaryen", |
||
38 | "name": "Targaryen", |
||
39 | "led_by": "DaenerysTargaryen", |
||
40 | "location_id": "dragonstone", |
||
41 | "en": { |
||
42 | "coat-of-arms": "A three-headed dragon breathing flames, red on black (Sable, a dragon thrice-headed gules)", |
||
43 | "description": "House Targaryen of Dragonstone is an exiled Great House of Westeros and the former royal House of the Seven Kingdoms. House Targaryen conquered and unified the realm before it was deposed during Robert\'s Rebellion and House Baratheon replaced it as the new royal House. The two surviving Targaryens, Viserys and Daenerys, fled into exile to the Free Cities of Essos across the Narrow Sea. House Lannister replaced House Baratheon as the royal House following the destruction of the Great Sept of Baelor, but the realm was reconquered by Daenerys Targaryen, retaking the Iron Throne following the Battle of King\'s Landing. After she laid waste to a surrendered King\'s Landing, Daenerys was assassinated by Jon Snow to prevent further destruction. Jon became the last known living member of House Targaryen and his identity as the son of Rhaegar Targaryen is kept hidden from Westeros. He is exiled to the Night\'s Watch for the assassination of Daenerys. The bloodline of House Targaryen also still exists in various houses, such as House Baratheon, House Velaryon, and House Martell.", |
||
44 | "words": "Fire and Blood" |
||
45 | } |
||
46 | } |
||
47 | ]'; |
||
48 | |||
49 | $houses = json_decode($houses, JSON_OBJECT_AS_ARRAY); |
||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||
50 | |||
51 | foreach ($houses as $house) { |
||
52 | House::insertOrIgnore($house); |
||
53 | } |
||
54 | } |
||
55 | } |
||
56 |