This commit is contained in:
2018-11-13 19:34:06 -06:00
parent 054e8e1734
commit e2e725a3d5

View File

@@ -24,18 +24,27 @@ class FleetsController extends Controller
public function displayFleets() { public function displayFleets() {
$fleets = DB::table('Fleets')->get(); $fleets = DB::table('Fleets')->get();
$fleetIds = array(); $data = array();
$fc = array();
$fleet = array();
$description = array();
$i = 0; $i = 0;
foreach($fleets as $fleet) {
$fleetIds[$i] = [ foreach($fleets as $fl) {
'fc' => $fleet->character_id, $fc[$i] = $fl->character_id;
'fleet' => $fleet->fleet, $fleet[$i] = $fl->fleet;
'description' => $fleet->description, $description[$i] = $fl->description;
];
$i++; $i++;
} }
$data = [
$fc,
$fleet,
$description,
];
//Return the view with the array of the fleet //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) { public function registerFleet(Request $request) {