converting all lookup functions to the new lookup helper

This commit is contained in:
2019-12-11 21:23:13 -06:00
parent 55225fdea3
commit 9e47568e67
14 changed files with 98 additions and 564 deletions
+10 -14
View File
@@ -2,33 +2,29 @@
namespace App\Library\Esi;
use DB;
//Models
use App\Models\Esi\EsiScope;
use App\Models\Esi\EsiToken;
use Seat\Eseye\Cache\NullCache;
use Seat\Eseye\Configuration;
use Seat\Eseye\Containers\EsiAuthentication;
use Seat\Eseye\Eseye;
//Library
use App\Library\Esi\Esi;
use Seat\Eseye\Exceptions\RequestFailedException;
class Mail {
public function SendMail($recipient, $rType, $subject, $body) {
//Declare some variables
$esiHelper = new Esi;
//Get the esi config
$config = config('esi');
//Retrieve the token for main character to send mails from
$token = EsiToken::where(['character_id' => $config['primary']])->first();
$token = $esiHelper->GetRefreshToken($config['primary']);
//Create the ESI authentication container
$config = config('esi');
$authentication = new EsiAuthentication([
'client_id' => $config['client_id'],
'secret' => $config['secret'],
'refresh_token' => $token->refresh_token,
]);
$esi = new Eseye($authentication);
$esi = $esiHelper->SetupEsiAuthentication($token);
//Try to send the mail
try {
$esi->setBody([
'approved_cost' => 0,