Show tipp result on dashboard
This commit is contained in:
@@ -15,10 +15,12 @@ class PagesController extends Controller
|
|||||||
function dashboard() {
|
function dashboard() {
|
||||||
$teams = Team::all();
|
$teams = Team::all();
|
||||||
$matches = Match::all();
|
$matches = Match::all();
|
||||||
|
$tipps = Tipp::where('user', Auth::user()->id)->get();
|
||||||
|
|
||||||
return view('dashboard')->with([
|
return view('dashboard')->with([
|
||||||
'teams' => $teams,
|
'teams' => $teams,
|
||||||
'matches' => $matches,
|
'matches' => $matches,
|
||||||
|
'tipps' => $tipps,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -25,6 +25,7 @@ class Tipp extends Model
|
|||||||
'matchid',
|
'matchid',
|
||||||
'resulta',
|
'resulta',
|
||||||
'resultb',
|
'resultb',
|
||||||
|
'score',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -39,12 +39,14 @@
|
|||||||
<td>{!! $teams->find($match->teama)->name !!}</td>
|
<td>{!! $teams->find($match->teama)->name !!}</td>
|
||||||
<td>{!! $teams->find($match->teamb)->name !!}</td>
|
<td>{!! $teams->find($match->teamb)->name !!}</td>
|
||||||
<td>{!! $match->resulta . ':' . $match->resultb !!}</td>
|
<td>{!! $match->resulta . ':' . $match->resultb !!}</td>
|
||||||
<td>-</td>
|
<td>{!! $tipps->where('matchid', $match->id)->resulta . ':' . $tipps->where('matchid', $match->id)->resultb !!}</td>
|
||||||
<td>
|
<td>
|
||||||
|
@if($tipps->where('matchid', $match->id)->resulta != null)
|
||||||
<!-- Edit -->
|
<!-- Edit -->
|
||||||
{!! Form::model($match, ['method' => 'GET', 'action' => ['PagesController@createTipp', $match->id], 'style' => 'display:inline-block;']) !!}
|
{!! Form::model($match, ['method' => 'GET', 'action' => ['PagesController@createTipp', $match->id], 'style' => 'display:inline-block;']) !!}
|
||||||
<button class="btn btn-primary" type="submit"><i class="fa fa-pencil-square-o" aria-hidden="true"></i></button>
|
<button class="btn btn-primary" type="submit">Tipp!<button>
|
||||||
{!! Form::close() !!}
|
{!! Form::close() !!}
|
||||||
|
@endif
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
Reference in New Issue
Block a user