From e2e725a3d5a755d51de40748a771203669043a0c Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Tue, 13 Nov 2018 19:34:06 -0600 Subject: [PATCH] fleets --- app/Http/Controllers/FleetsController.php | 25 +++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/app/Http/Controllers/FleetsController.php b/app/Http/Controllers/FleetsController.php index 9787e9691..cd26ff2ae 100644 --- a/app/Http/Controllers/FleetsController.php +++ b/app/Http/Controllers/FleetsController.php @@ -24,18 +24,27 @@ class FleetsController extends Controller public function displayFleets() { $fleets = DB::table('Fleets')->get(); - $fleetIds = array(); + $data = array(); + $fc = array(); + $fleet = array(); + $description = array(); $i = 0; - foreach($fleets as $fleet) { - $fleetIds[$i] = [ - 'fc' => $fleet->character_id, - 'fleet' => $fleet->fleet, - 'description' => $fleet->description, - ]; + + foreach($fleets as $fl) { + $fc[$i] = $fl->character_id; + $fleet[$i] = $fl->fleet; + $description[$i] = $fl->description; $i++; } + + $data = [ + $fc, + $fleet, + $description, + ]; + //Return the view with the array of the fleet - return view('fleets.displayfleets')->with('fleetIds', $fleetIds); + return view('fleets.displayfleets')->with($data); } public function registerFleet(Request $request) {