From ebf1e8c27029b865039368c2d4d96fac666dcbf4 Mon Sep 17 00:00:00 2001 From: structix Date: Sat, 2 Jun 2018 00:23:11 +0200 Subject: [PATCH] Added matches --- .../app/Http/Controllers/PagesController.php | 2 + tippspiel/app/Match.php | 40 +++++++++++++++++++ tippspiel/resources/views/dashboard.blade.php | 4 +- 3 files changed, 44 insertions(+), 2 deletions(-) create mode 100755 tippspiel/app/Match.php diff --git a/tippspiel/app/Http/Controllers/PagesController.php b/tippspiel/app/Http/Controllers/PagesController.php index e58ac38..e5fe5c7 100644 --- a/tippspiel/app/Http/Controllers/PagesController.php +++ b/tippspiel/app/Http/Controllers/PagesController.php @@ -9,9 +9,11 @@ class PagesController extends Controller { function dashboard() { $teams = Team::all(); + $matches = Match::all(); return view('dashboard')->with([ 'teams' => $teams, + 'matches' => $matches, ]); } } diff --git a/tippspiel/app/Match.php b/tippspiel/app/Match.php new file mode 100755 index 0000000..06ab3da --- /dev/null +++ b/tippspiel/app/Match.php @@ -0,0 +1,40 @@ + - @foreach($teams as $t) + @foreach($matches as $match) - {!! $t->name !!} + {!! $teams->find($match->teama) !!} Column content Column content Column content