diff --git a/app/Http/Controllers/AfterActionReports/AfterActionReportsController.php b/app/Http/Controllers/AfterActionReports/AfterActionReportsController.php index 83c8694fc..92cb1b5ab 100644 --- a/app/Http/Controllers/AfterActionReports/AfterActionReportsController.php +++ b/app/Http/Controllers/AfterActionReports/AfterActionReportsController.php @@ -78,8 +78,10 @@ class AfterActionReportsController extends Controller //Grab all the reports $reports = AfterActionReport::where('created_at', '>=', Carbon::now()->subDays(30)); $comments = AfterActionReportComment::where('created_at', '>=', Carbon::now()->subDays(30)); + $reportCount = AfterActionReport::where('created_at', '>=', Carbon::now()->subDays(30))->count(); return view('reports.user.displayreports')->with('reports', $reports) - ->with('comments', $comments); + ->with('comments', $comments) + ->with('reportCount', $reportCount); } } diff --git a/resources/views/reports/user/displayreports.blade.php b/resources/views/reports/user/displayreports.blade.php index 5c91fc240..b589eec6f 100644 --- a/resources/views/reports/user/displayreports.blade.php +++ b/resources/views/reports/user/displayreports.blade.php @@ -1,7 +1,7 @@ @extends('layouts.user.dashb4') @section('content')
-@if($reports != null) +@if($reportCount > 0) @foreach($reports as $report)