custom moon test
This commit is contained in:
@@ -14,8 +14,15 @@ class MoonsController extends Controller
|
|||||||
{
|
{
|
||||||
public function displayMoons() {
|
public function displayMoons() {
|
||||||
$moons = DB::table('moons')->get();
|
$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($moons);
|
return view('moons.moon')->with($moonsHtml);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function addMoon() {
|
public function addMoon() {
|
||||||
|
|||||||
@@ -20,13 +20,7 @@
|
|||||||
<th>Rental End</th>
|
<th>Rental End</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@if(sizeof($moons) > 0)
|
{{ $moonsHtml }}
|
||||||
@foreach ($moons as $moon)
|
|
||||||
<tr>
|
|
||||||
<td>{{ $moon }}</td>
|
|
||||||
</tr>
|
|
||||||
@endforeach
|
|
||||||
@endif
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user