Added Team model
This commit is contained in:
@@ -3,12 +3,14 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
|
use App\Team;
|
||||||
|
|
||||||
class PagesController extends Controller
|
class PagesController extends Controller
|
||||||
{
|
{
|
||||||
function dashboard() {
|
function dashboard() {
|
||||||
|
$teams = Team::all();
|
||||||
return view('dashboard')->with([
|
return view('dashboard')->with([
|
||||||
|
$teams => 'teams',
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
34
tippspiel/app/Team.php
Executable file
34
tippspiel/app/Team.php
Executable file
@@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App;
|
||||||
|
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
|
||||||
|
class Team extends Model
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The database table uses by the model.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $table = 'team';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes that are mass assignable.
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $fillable = [
|
||||||
|
'id',
|
||||||
|
'name',
|
||||||
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The attributes excluded from the model's JSON form
|
||||||
|
*
|
||||||
|
* @var array
|
||||||
|
*/
|
||||||
|
protected $hidden = [
|
||||||
|
//
|
||||||
|
];
|
||||||
|
}
|
@@ -24,20 +24,23 @@
|
|||||||
<table class="table table-hover">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">Type</th>
|
<th scope="col">Nr.</th>
|
||||||
<th scope="col">Column heading</th>
|
<th scope="col">Mannschaft A</th>
|
||||||
<th scope="col">Column heading</th>
|
<th scope="col">Mannschaft B</th>
|
||||||
<th scope="col">Column heading</th>
|
<th scope="col">Tipp</th>
|
||||||
|
<th scope="col">Bearbeiten</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@foreach($teams as $t)
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">Default</th>
|
<th{!! $t->name !!}</th>
|
||||||
<td>Column content</td>
|
<td>Column content</td>
|
||||||
<td>Column content</td>
|
<td>Column content</td>
|
||||||
<td>Column content</td>
|
<td>Column content</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
@endforeach
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Reference in New Issue
Block a user