Added matches
This commit is contained in:
@@ -9,9 +9,11 @@ class PagesController extends Controller
|
|||||||
{
|
{
|
||||||
function dashboard() {
|
function dashboard() {
|
||||||
$teams = Team::all();
|
$teams = Team::all();
|
||||||
|
$matches = Match::all();
|
||||||
|
|
||||||
return view('dashboard')->with([
|
return view('dashboard')->with([
|
||||||
'teams' => $teams,
|
'teams' => $teams,
|
||||||
|
'matches' => $matches,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
40
tippspiel/app/Match.php
Executable file
40
tippspiel/app/Match.php
Executable 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 = [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
@@ -32,9 +32,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@foreach($teams as $t)
|
@foreach($matches as $match)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{!! $t->name !!}</td>
|
<td>{!! $teams->find($match->teama) !!}</td>
|
||||||
<td>Column content</td>
|
<td>Column content</td>
|
||||||
<td>Column content</td>
|
<td>Column content</td>
|
||||||
<td>Column content</td>
|
<td>Column content</td>
|
||||||
|
Reference in New Issue
Block a user