2019-10-29 03:55:26 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2020-01-07 01:13:47 +01:00
|
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
2019-10-29 03:55:26 +01:00
|
|
|
*
|
|
|
|
* @license https://opensource.org/licenses/AAL
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Jobs\Util;
|
|
|
|
|
|
|
|
use App\Models\Client;
|
|
|
|
use App\Models\SystemLog;
|
|
|
|
use Illuminate\Bus\Queueable;
|
|
|
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
|
|
|
use Illuminate\Foundation\Bus\Dispatchable;
|
|
|
|
use Illuminate\Http\File;
|
|
|
|
use Illuminate\Http\Request;
|
|
|
|
use Illuminate\Queue\InteractsWithQueue;
|
|
|
|
use Illuminate\Queue\SerializesModels;
|
|
|
|
use Illuminate\Support\Facades\Storage;
|
|
|
|
use Intervention\Image\ImageManager;
|
|
|
|
|
|
|
|
class SystemLogger implements ShouldQueue
|
|
|
|
{
|
|
|
|
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
|
|
|
|
|
|
|
protected $log;
|
|
|
|
|
|
|
|
protected $category_id;
|
|
|
|
|
|
|
|
protected $event_id;
|
|
|
|
|
|
|
|
protected $type_id;
|
|
|
|
|
|
|
|
protected $client;
|
|
|
|
|
|
|
|
public function __construct($log, $category_id, $event_id, $type_id, Client $client)
|
|
|
|
{
|
|
|
|
$this->log = $log;
|
|
|
|
$this->category_id = $category_id;
|
|
|
|
$this->event_id = $event_id;
|
|
|
|
$this->type_id = $type_id;
|
|
|
|
$this->client = $client;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function handle() :void
|
|
|
|
{
|
2019-12-30 22:59:12 +01:00
|
|
|
$sl = [
|
2019-10-29 03:55:26 +01:00
|
|
|
'client_id' => $this->client->id,
|
|
|
|
'company_id' => $this->client->company->id,
|
|
|
|
'user_id' => $this->client->user_id,
|
|
|
|
'log' => $this->log,
|
|
|
|
'category_id' => $this->category_id,
|
|
|
|
'event_id' => $this->event_id,
|
|
|
|
'type_id' => $this->type_id,
|
|
|
|
];
|
|
|
|
|
|
|
|
SystemLog::create($sl);
|
|
|
|
}
|
2019-12-30 22:59:12 +01:00
|
|
|
}
|