1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-21 08:51:34 +02:00
invoiceninja/app/Jobs/Util/SystemLogger.php
David Bomba 957ac9f5d8
Fix for password protected authorization (#3198)
* Remove unnecessary save() on invoice

* Update copyright

* Working on Credit Repository

* Implement credits as a paymentable entity

* Add credit_id to transformer

* fix rules for update payment

* Fix random deleted_at keys in transformers

* Fix for password_protect check
2020-01-07 11:13:47 +11:00

64 lines
1.6 KiB
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com)
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
*
* @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
{
$sl = [
'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);
}
}