diff --git a/app/Http/Controllers/Dashboard/DashboardController.php b/app/Http/Controllers/Dashboard/DashboardController.php index 98a8207..c283d83 100644 --- a/app/Http/Controllers/Dashboard/DashboardController.php +++ b/app/Http/Controllers/Dashboard/DashboardController.php @@ -23,6 +23,7 @@ class DashboardController extends Controller //Declare array variable $contracts = array(); + $num = 0; //Get the current amount of contracts availabe to the corporation for displaying on the dashboard with the relevant //information such as pickup and destination, jumps, and profit margin. @@ -61,11 +62,10 @@ class DashboardController extends Controller ]; array_push($contracts, $final); + $num++; } } - $num = sizeof($contracts); - return view('dashboard.dashboard')->with('contracts', $contracts) ->with('num', $num); } diff --git a/resources/views/dashboard/dashboard.blade.php b/resources/views/dashboard/dashboard.blade.php index a27bc61..add346a 100644 --- a/resources/views/dashboard/dashboard.blade.php +++ b/resources/views/dashboard/dashboard.blade.php @@ -12,6 +12,7 @@
+@if($num > 0)
@@ -40,4 +41,5 @@
+@endif @endsection \ No newline at end of file