mirror of
https://github.com/archtechx/tenancy.git
synced 2026-02-05 02:14:03 +00:00
Handle phpstan errors
This commit is contained in:
parent
ae568e1227
commit
ea9690f915
1 changed files with 5 additions and 1 deletions
|
|
@ -17,7 +17,10 @@ class CreateRLSPoliciesForTenantTables extends Command
|
|||
public function handle(): int
|
||||
{
|
||||
foreach (config('tenancy.models.rls') as $modelClass) {
|
||||
$this->makeModelUseRls((new $modelClass));
|
||||
/** @var Model $model */
|
||||
$model = new $modelClass;
|
||||
|
||||
$this->makeModelUseRls($model);
|
||||
}
|
||||
|
||||
return Command::SUCCESS;
|
||||
|
|
@ -53,6 +56,7 @@ class CreateRLSPoliciesForTenantTables extends Command
|
|||
$table = $model->getTable();
|
||||
$tenantKey = tenancy()->tenantKeyColumn();
|
||||
|
||||
/** @phpstan-ignore-next-line */
|
||||
$parentName = $model->getRelationshipToPrimaryModel();
|
||||
$parentKey = $model->$parentName()->getForeignKeyName();
|
||||
$parentModel = $model->$parentName()->make();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue