übergang auf pakete, integration von stripe und paypal, blog hinzugefügt.
This commit is contained in:
@@ -7,6 +7,8 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasManyThrough;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Tenant extends Model
|
||||
@@ -51,9 +53,9 @@ class Tenant extends Model
|
||||
return $this->hasMany(TenantPackage::class);
|
||||
}
|
||||
|
||||
public function activeResellerPackage()
|
||||
public function activeResellerPackage(): HasOne
|
||||
{
|
||||
return $this->tenantPackages()->where('active', true)->first();
|
||||
return $this->hasOne(TenantPackage::class)->where('active', true);
|
||||
}
|
||||
|
||||
public function canCreateEvent(): bool
|
||||
@@ -93,4 +95,9 @@ class Tenant extends Model
|
||||
get: fn () => $this->activeResellerPackage() !== null,
|
||||
);
|
||||
}
|
||||
|
||||
public function user(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user