Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Setup the dispatching event Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com> * Setup Audit dispatching and queuing Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com> * Finish customization and tests Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com> * Remove ray Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com> * Change the config description Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com> * Fix config issues Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com> * Fix resolving users in the queue Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com> * Revert "Fix resolving users in the queue" This reverts commit 6c44a2e. * Revert "Revert "Fix resolving users in the queue"" This reverts commit 22cfbb9. * Fix the observer Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com> * Remove retrieved Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com> * Only run listener test in Laravel 8 and above Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com> * Fix PHP 7.4 issues Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com> --------- Signed-off-by: Kevin Ullyott <ullyott.kevin@gmail.com> Co-authored-by: Dan Harrin <git@danharrin.com>
- Loading branch information
Showing
16 changed files
with
330 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace OwenIt\Auditing\Events; | ||
|
||
use OwenIt\Auditing\Contracts\Auditable; | ||
use Illuminate\Foundation\Events\Dispatchable; | ||
|
||
class DispatchAudit | ||
{ | ||
use Dispatchable; | ||
|
||
/** | ||
* The Auditable model. | ||
* | ||
* @var Auditable | ||
*/ | ||
public $model; | ||
|
||
/** | ||
* Create a new DispatchAudit event instance. | ||
* | ||
* @param Auditable $model | ||
*/ | ||
public function __construct(Auditable $model) | ||
{ | ||
$this->model = $model; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
|
||
namespace OwenIt\Auditing\Events; | ||
|
||
use OwenIt\Auditing\Contracts\Auditable; | ||
|
||
class DispatchingAudit | ||
{ | ||
/** | ||
* The Auditable model. | ||
* | ||
* @var Auditable | ||
*/ | ||
public $model; | ||
|
||
/** | ||
* Create a new DispatchingAudit event instance. | ||
* | ||
* @param Auditable $model | ||
*/ | ||
public function __construct(Auditable $model) | ||
{ | ||
$this->model = $model; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace OwenIt\Auditing\Listeners; | ||
|
||
use OwenIt\Auditing\Facades\Auditor; | ||
use Illuminate\Support\Facades\Config; | ||
use OwenIt\Auditing\Events\DispatchAudit; | ||
use Illuminate\Contracts\Queue\ShouldQueue; | ||
|
||
class ProcessDispatchAudit implements ShouldQueue | ||
{ | ||
public function viaConnection(): string | ||
{ | ||
return Config::get('audit.queue.connection', 'sync'); | ||
} | ||
|
||
public function viaQueue(): string | ||
{ | ||
return Config::get('audit.queue.queue', 'default'); | ||
} | ||
|
||
public function withDelay(DispatchAudit $event): int | ||
{ | ||
return Config::get('audit.queue.delay', 0); | ||
} | ||
|
||
public function handle(DispatchAudit $event) | ||
{ | ||
Auditor::execute($event->model); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.