fleets
This commit is contained in:
@@ -65,8 +65,6 @@ class FleetsController extends Controller
|
|||||||
$fleet->SetFleetEndTime($endTime);
|
$fleet->SetFleetEndTime($endTime);
|
||||||
//Set the fleet into the session to be used later
|
//Set the fleet into the session to be used later
|
||||||
session(['fleet' => $fleet]);
|
session(['fleet' => $fleet]);
|
||||||
$fleet = session('fleet');
|
|
||||||
dd($fleet);
|
|
||||||
|
|
||||||
//Return the view with the success message
|
//Return the view with the success message
|
||||||
return view('fleets.displayfleets')->with('success', 'Fleet registered.');
|
return view('fleets.displayfleets')->with('success', 'Fleet registered.');
|
||||||
@@ -81,7 +79,7 @@ class FleetsController extends Controller
|
|||||||
$fleet = session('fleet');
|
$fleet = session('fleet');
|
||||||
dd($fleet);
|
dd($fleet);
|
||||||
//Add a pilot to the fleet
|
//Add a pilot to the fleet
|
||||||
$error = $fleet->AddPilot(Auth::user()->character_id);
|
$error = $fleet->AddPilot($id);
|
||||||
if($error) {
|
if($error) {
|
||||||
return view('fleets.displaystanding')->with('error', 'Unable to add to fleet.');
|
return view('fleets.displaystanding')->with('error', 'Unable to add to fleet.');
|
||||||
} else {
|
} else {
|
||||||
@@ -89,9 +87,9 @@ class FleetsController extends Controller
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function updateFleet(Request $request) {
|
public function updateFleet() {
|
||||||
//Retrieve the fleet from the session
|
//Retrieve the fleet from the session
|
||||||
$fleet = $request->session()->get('fleet');
|
$fleet = session('fleet');
|
||||||
$fleet->UpdateFleet($request->isFreeMove, $request->motd);
|
$fleet->UpdateFleet($request->isFreeMove, $request->motd);
|
||||||
|
|
||||||
return view('fleets.displaystanding')->with('success', 'Fleet updated.');
|
return view('fleets.displaystanding')->with('success', 'Fleet updated.');
|
||||||
|
|||||||
@@ -82,7 +82,24 @@ class Fleet {
|
|||||||
public function AddPilot($charId) {
|
public function AddPilot($charId) {
|
||||||
//Get the ESI token for the FC to add the new pilot
|
//Get the ESI token for the FC to add the new pilot
|
||||||
$token = DB::table('EsiTokens')->where('character_id', $this->fcId)->first();
|
$token = DB::table('EsiTokens')->where('character_id', $this->fcId)->first();
|
||||||
//Create the ESI Call
|
//Create the ESI Call Container
|
||||||
|
$authentication = new EsiAuthentication([
|
||||||
|
'client_id' => env('ESI_CLIENT_ID'),
|
||||||
|
'secret' => env('ESI_SECRET_KEY'),
|
||||||
|
'refresh_token' => $token->refresh_token,
|
||||||
|
]);
|
||||||
|
//Crate the ESI Class
|
||||||
|
$esi = new Eseye($authentication);
|
||||||
|
//Perform the call to ESI
|
||||||
|
$error = $esi->invoke('post', '/fleets/{fleet_id}/members/', [
|
||||||
|
'fleet_id' => $this->fleet,
|
||||||
|
'invitation' => [
|
||||||
|
'character_id' => $charId,
|
||||||
|
'role' => 'squad_member',
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
return $error;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function RenderFleetDisplay() {
|
public function RenderFleetDisplay() {
|
||||||
|
|||||||
Reference in New Issue
Block a user