first commit

This commit is contained in:
ExtraNetwork
2026-05-12 17:04:54 +03:00
commit e5c4b6aa13
1425 changed files with 284735 additions and 0 deletions

52
app/Jobs/SlackLogJob.php Normal file
View File

@@ -0,0 +1,52 @@
<?php
namespace App\Jobs;
use App\Exceptions\ApiErrorException;
use GuzzleHttp\Client;
use GuzzleHttp\Exception\RequestException;
use Log;
use Exception;
class SlackLogJob extends Job
{
protected $slack;
public $tries = 1;
public $timeout = 60;
public function __construct($slack)
{
$this->slack = $slack;
}
public function handle()
{
try {
$client = new Client();
$client->request('POST', config('app.log_slack'),
[
'headers' => [
'Content-Type' => 'application/json'
],
'body' => json_encode($this->slack),
]);
} catch (Exception $e) {
$message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
Log::error('--SlackLogJob RequestException--');
Log::error($message);
} catch (RequestException $e) {
$message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
Log::error('--SlackLogJob RequestException--');
Log::error($message);
} catch (ApiErrorException $e) {
$message = $e->getFile() . " " . $e->getLine() . " " . $e->getMessage();
Log::error('--SlackLogJob ApiErrorException--');
Log::error($message);
}
}
}