Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
one2tek-ak committed Sep 15, 2022
1 parent 111880d commit e2f47b5
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions src/Jobs/CreateLog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

namespace one2tek\laralog\Jobs;

use Exception;
use Illuminate\Bus\Queueable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use one2tek\laralog\Models\LaraLog;

class CreateLog implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;

private $data;

/**
* Create a new job instance.
*
* @return void
*/
public function __construct($data)
{
$this->data = $data;
}

/**
* Execute the job.
* @return void
* @throws Exception
*/
public function handle()
{
try {
(new LaraLog())->create($this->data);
} catch (Exception $e) {
throw $e;
}
}
}

0 comments on commit e2f47b5

Please sign in to comment.