Added matches

This commit is contained in:
2018-06-02 00:23:11 +02:00
parent c20b7bbc78
commit ebf1e8c270
3 changed files with 44 additions and 2 deletions

View File

@@ -9,9 +9,11 @@ class PagesController extends Controller
{
function dashboard() {
$teams = Team::all();
$matches = Match::all();
return view('dashboard')->with([
'teams' => $teams,
'matches' => $matches,
]);
}
}

40
tippspiel/app/Match.php Executable file
View File

@@ -0,0 +1,40 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Team extends Model
{
public $timestamps = false;
/**
* The database table uses by the model.
*
* @var string
*/
protected $table = 'matches';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'id',
'teama',
'teamb',
'date',
'comment',
'resulta',
'resultb',
];
/**
* The attributes excluded from the model's JSON form
*
* @var array
*/
protected $hidden = [
//
];
}

View File

@@ -32,9 +32,9 @@
</tr>
</thead>
<tbody>
@foreach($teams as $t)
@foreach($matches as $match)
<tr>
<td>{!! $t->name !!}</td>
<td>{!! $teams->find($match->teama) !!}</td>
<td>Column content</td>
<td>Column content</td>
<td>Column content</td>