scopes and other files

This commit is contained in:
2018-11-18 21:00:37 -06:00
parent 9a635faa4c
commit 4dbb1e3bb0
11 changed files with 84 additions and 11 deletions
+10 -1
View File
@@ -4,6 +4,10 @@ namespace App\Console\Commands;
use Illuminate\Console\Command;
use DB;
use App\Library\Finances;
class corpJournal extends Command
{
/**
@@ -37,6 +41,11 @@ class corpJournal extends Command
*/
public function handle()
{
//
//Get the characters that have the esi-wallet.read_corporation_wallets.v1
//esi wallet scope
$characters = DB::table('EsiScopes')->where('scopes', 'esi-wallet.read_corporation_wallets.v1')->get();
foreach($characters as $char) {
}
}
}
+35 -1
View File
@@ -4,6 +4,13 @@ namespace App\Console\Commands;
use Illuminate\Console\Command;
use App\Models\AllianceCorp;
use Seat\Eseye\Cache\NullCache;
use Seat\Eseye\Configuration;
use Seat\Eseye\Containers\EsiAuthentication;
use Seat\Eseye\Eseye;
class getCorps extends Command
{
/**
@@ -37,6 +44,33 @@ class getCorps extends Command
*/
public function handle()
{
//
//Set the parameters for ESI
$configuration = Configuration::getInstance();
$configuration->logfile_location = 'var/www/w4rpservices/storage/logs/eseye';
//Create the ESI container
$esi = new Eseye();
//try the esi call to get all of the corporations in the alliance
try {
$corporations = $esi->invoke('get', '/alliances/{alliance_id}/corporations/', [
'alliance_id' => 99004116,
]);
} catch(\Seat\Eseye\Exceptions\RequestFailedException $e){
dd($e->getEsiResponse());
}
//Delete all of the entries in the AllianceCorps table
DB::table('AllianceCorps')->delete();
foreach($corporations as $corp) {
try {
$corpInfo = $esi->invoke('get', '/corporations/{corporation_id}/', [
'corporation_id' => $corp,
]);
} catch(\Seat\Eseye\Exceptions\RequestFailedException $e) {
return $e->getEsiResponse();
}
$entry = new AllianceCorp;
$entry->corporation_id = $corp;
$entry->name = $corpInfo->name;
$entry->save();
}
}
}
+5 -1
View File
@@ -21,7 +21,11 @@ class EsiScopeController extends Controller
}
public function displayScopes() {
return view('scopes.select');
//Get the ESI Scopes for the user
$scopes = DB::table('EsiScopes')->where('character_id', Auth::user()->character_id)->get();
//We want to send the scopes to the page as pre-checked.
dd($scopes);
return view('scopes.select')->with('scopes', $scopes);
}
public function redirectToProvider(Request $request) {
+4 -4
View File
@@ -110,8 +110,8 @@ class Finances {
//Create the ESI authentication container
$config = config('esi');
$authentication = new EsiAuthentication([
'client_id' => $config['esi']['client_id'],
'secret' => $config['esi']['secret'],
'client_id' => $config['client_id'],
'secret' => $config['secret'],
'refresh_token' => $token[0]->refresh_token,
]);
//Create the esi class variable
@@ -142,8 +142,8 @@ class Finances {
//Create the ESI authentication container
$config = config('esi');
$authentication = new EsiAuthentication([
'client_id' => $config['esi']['client_id'],
'secret' => $config['esi']['secret'],
'client_id' => $config['client_id'],
'secret' => $config['secret'],
'refresh_token' => $token[0]->refresh_token,
]);
//Create the esi class variable
+4 -4
View File
@@ -68,8 +68,8 @@ class Fleet {
//Create the esi authentication container
$config = config('esi');
$authentication = new \Seat\Eseye\Containers\EsiAuthentication([
'client_id' => $config['esi']['client_id'],
'secret' => $config['esi']['secret'],
'client_id' => $config['client_id'],
'secret' => $config['secret'],
'refresh_token' => $token->refresh_token,
]);
//Create the esi class
@@ -98,8 +98,8 @@ class Fleet {
//Create the ESI Call Container
$config = config('esi');
$authentication = new \Seat\Eseye\Containers\EsiAuthentication([
'client_id' => $config['esi']['client_id'],
'secret' => $config['esi']['secret'],
'client_id' => $config['client_id'],
'secret' => $config['secret'],
'refresh_token' => $token[0]->refresh_token,
]);
$esi = new \Seat\Eseye\Eseye($authentication);
+1
View File
@@ -23,5 +23,6 @@ class AllianceCorp extends Model
*/
protected $fillable = [
'corporation_id',
'name',
];
}