mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 21:54:03 +00:00
Queue tests
This commit is contained in:
parent
00bb0d06b3
commit
86a98b2bc8
13 changed files with 216 additions and 124 deletions
|
|
@ -2,13 +2,15 @@
|
|||
|
||||
namespace Stancl\Tenancy\Database\Models\Concerns;
|
||||
|
||||
use Stancl\Tenancy\Contracts\UniqueIdentifierGenerator;
|
||||
|
||||
trait GeneratesIds
|
||||
{
|
||||
public static function bootGeneratesIds()
|
||||
{
|
||||
static::creating(function (self $model) {
|
||||
if (! $model->id && config('tenancy.id_generator')) {
|
||||
$model->id = app(config('tenancy.id_generator'))->generate($model);
|
||||
if (! $model->id && app()->bound(UniqueIdentifierGenerator::class)) {
|
||||
$model->id = app(UniqueIdentifierGenerator::class)->generate($model);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue