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() { public function displayMoons() {
$moons = DB::table('moons')->get(); $moons = DB::table('moons')->get();
//return view('moons.moon')->with('moons', $moons); return view('moons.moon')->with($moons);
return view('moons.moon', compact('moons'));
} }
public function addMoon() { public function addMoon() {

View File

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