mirror of
https://github.com/archtechx/tenancy.git
synced 2025-12-12 14:14:04 +00:00
more phpstan fixes
This commit is contained in:
parent
a4318d81bd
commit
87e02f207f
4 changed files with 15 additions and 2 deletions
|
|
@ -27,9 +27,16 @@ class Domain extends Model implements Contracts\Domain
|
|||
|
||||
protected $guarded = [];
|
||||
|
||||
/**
|
||||
* @return BelongsTo<Tenant&Model, $this>
|
||||
*/
|
||||
public function tenant(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(config('tenancy.models.tenant'), Tenancy::tenantKeyColumn());
|
||||
/** @var class-string<Tenant&Model> $tenantModel */
|
||||
$tenantModel = config('tenancy.models.tenant');
|
||||
|
||||
/** @var BelongsTo<Model&Tenant, $this> */
|
||||
return $this->belongsTo($tenantModel, Tenancy::tenantKeyColumn());
|
||||
}
|
||||
|
||||
protected $dispatchesEvents = [
|
||||
|
|
|
|||
|
|
@ -63,6 +63,10 @@ class Tenant extends Model implements Contracts\Tenant
|
|||
return static::current() ?? throw new TenancyNotInitializedException;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array<self> $models
|
||||
* @return TenantCollection<int|string, self>
|
||||
*/
|
||||
public function newCollection(array $models = []): TenantCollection
|
||||
{
|
||||
return new TenantCollection($models);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue