We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1fab0b4 commit d733dc5Copy full SHA for d733dc5
src/Database/Eloquent/Concerns/HasTenantResources.php
@@ -33,12 +33,24 @@ public static function bootHasTenantResources(): void
33
if ($model->getAttribute($model->getTenantResourceKeyName()) === null) {
34
$model->setAttribute(
35
$model->getTenantResourceKeyName(),
36
- Str::uuid()
+ method_exists($model, 'generateNewResourceKey')
37
+ ? $model->generateNewResourceKey()
38
+ : Str::uuid()
39
);
40
}
41
});
42
43
44
+ /**
45
+ * Generate a new resource key
46
+ *
47
+ * @return mixed
48
+ */
49
+ public function generateNewResourceKey(): mixed
50
+ {
51
+ return Str::uuid();
52
+ }
53
+
54
/**
55
* Get the resource key used to identify the tenants resources
56
*
0 commit comments