blade template
This commit is contained in:
@@ -14,15 +14,8 @@ class MoonsController extends Controller
|
||||
{
|
||||
public function displayMoons() {
|
||||
$moons = DB::table('moons')->get();
|
||||
$moonsHtml = '';
|
||||
foreach($moons as $moon) {
|
||||
$moonsHtml .= '<td>' . $moon->system . '</td>';
|
||||
$moonsHtml .= '<td>' . $moon->strucure . '</td>';
|
||||
$moonsHtml .= '<td>' . $moon->firstore . '</td>';
|
||||
$moonsHtml .= '<td>' . $moon->firstquan . '</td>';
|
||||
}
|
||||
|
||||
return view('moons.moon')->with($moonsHtml);
|
||||
return view('moons.moon')->with($moons);
|
||||
}
|
||||
|
||||
public function addMoon() {
|
||||
|
||||
@@ -20,7 +20,24 @@
|
||||
<th>Rental End</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
{{ $moonsHtml }}
|
||||
@if(sizeof($moons) > 0)
|
||||
@foreach ($moons as $moon)
|
||||
<tr>
|
||||
<td>{{ $moon['system'] }}</td>
|
||||
<td>{{ $moon['structure'] }}</td>
|
||||
<td>{{ $moon['firstore'] }}</td>
|
||||
<td>{{ $moon['firstquan'] }}</td>
|
||||
<td>{{ $moon['secondore'] }}</td>
|
||||
<td>{{ $moon['secondquan'] }}</td>
|
||||
<td>{{ $moon['thirdore'] }}</td>
|
||||
<td>{{ $moon['thirdquan'] }}</td>
|
||||
<td>{{ $moon['fourthore'] }}</td>
|
||||
<td>{{ $moon['price'] }}</td>
|
||||
<td>{{ $moon['renter'] }}</td>
|
||||
<td>{{ $moon['rentend'] }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user