mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 19:14:04 +00:00
Refactor more old code and get tests to pass
This commit is contained in:
parent
c5377a16f7
commit
c32f229dd5
72 changed files with 425 additions and 531 deletions
26
src/Listeners/QueueableListener.php
Normal file
26
src/Listeners/QueueableListener.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
|
||||
namespace Stancl\Tenancy\Listeners;
|
||||
|
||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||
|
||||
/**
|
||||
* @method handle(object $event)
|
||||
*/
|
||||
abstract class QueueableListener implements ShouldQueue
|
||||
{
|
||||
public static $shouldQueue = false;
|
||||
|
||||
public function shouldQueue($event)
|
||||
{
|
||||
if (static::$shouldQueue) {
|
||||
return true;
|
||||
} else {
|
||||
// The listener is not queued so we manually
|
||||
// pass the event to the handle() method.
|
||||
$this->handle($event);
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue