summaryrefslogtreecommitdiff
path: root/database/seeds/MatchSeeder.php
diff options
context:
space:
mode:
authorFbenas <philbeansburton@gmail.com>2020-06-19 02:16:51 +0100
committerFbenas <philbeansburton@gmail.com>2020-06-19 02:16:51 +0100
commitd1fe4536cc039450b540104e382db0d01d5cf886 (patch)
treefd40ab48f79370541f377b59bb381811126485ad /database/seeds/MatchSeeder.php
parentc83e876693bdb71c66418c13f5e09dfdaef24478 (diff)
Initial commit
Diffstat (limited to 'database/seeds/MatchSeeder.php')
-rw-r--r--database/seeds/MatchSeeder.php58
1 files changed, 58 insertions, 0 deletions
diff --git a/database/seeds/MatchSeeder.php b/database/seeds/MatchSeeder.php
new file mode 100644
index 0000000..f0d95f6
--- /dev/null
+++ b/database/seeds/MatchSeeder.php
@@ -0,0 +1,58 @@
+<?php
+
+use Illuminate\Database\Seeder;
+use App\Rugby\Model;
+
+class MatchSeeder extends Seeder
+{
+ /**
+ * Run the database seeds.
+ *
+ * @return void
+ */
+ public function run()
+ {
+ $match1 = Model\Match::create(
+ [
+ 'venue_id' => 1,
+ ]
+ );
+
+ $match1->teams()->sync(
+ [
+ 1 => ['is_home' => true],
+ 4 => ['is_home' => false]
+ ]
+ );
+
+ $match2 = Model\Match::create(
+ [
+ 'venue_id' => 2,
+ ]
+ );
+
+ $match2->teams()->sync(
+ [
+ 2 => ['is_home' => true],
+ 5 => ['is_home' => false]
+ ]
+ );
+
+ $match3 = Model\Match::create(
+ [
+ 'venue_id' => 3,
+ ]
+ );
+
+ $match3->teams()->sync(
+ [
+ 3 => ['is_home' => true],
+ 6 => ['is_home' => false]
+ ]
+ );
+
+ $match1->tournaments()->sync(1);
+ $match2->tournaments()->sync(1);
+ $match3->tournaments()->sync(1);
+ }
+}