checking for a number of moons

This commit is contained in:
2018-10-25 20:37:29 -05:00
parent dbcad23ba5
commit 8f9b55bfda
2 changed files with 3 additions and 2 deletions

View File

@@ -15,8 +15,7 @@ class MoonsController extends Controller
public function displayMoons() {
$moons = DB::table('moons')->get();
//return view('moons.moon')->with('moons', $moons);
return view('moons.moon', compact('moons'));
return view('moons.moon')->with($moons);
}
public function addMoon() {

View File

@@ -20,6 +20,7 @@
<th>Rental End</th>
</thead>
<tbody>
@if(sizeof($moons) > 0)
@foreach ($moons as $moon)
<tr>
<td>{{ $moon->system }}</td>
@@ -36,6 +37,7 @@
<td>{{ $moon->rentend }}</td>
</tr>
@endforeach
@endif
</tbody>
</table>
</div>