Added Team model
This commit is contained in:
@@ -3,12 +3,14 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Team;
|
||||
|
||||
class PagesController extends Controller
|
||||
{
|
||||
function dashboard() {
|
||||
$teams = Team::all();
|
||||
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">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Type</th>
|
||||
<th scope="col">Column heading</th>
|
||||
<th scope="col">Column heading</th>
|
||||
<th scope="col">Column heading</th>
|
||||
<th scope="col">Nr.</th>
|
||||
<th scope="col">Mannschaft A</th>
|
||||
<th scope="col">Mannschaft B</th>
|
||||
<th scope="col">Tipp</th>
|
||||
<th scope="col">Bearbeiten</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($teams as $t)
|
||||
<tr>
|
||||
<th scope="row">Default</th>
|
||||
<th{!! $t->name !!}</th>
|
||||
<td>Column content</td>
|
||||
<td>Column content</td>
|
||||
<td>Column content</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
@endforeach
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user