softdeletes für packages eingerichtet
This commit is contained in:
@@ -36,7 +36,7 @@ class AbandonedCheckout extends Model
|
||||
|
||||
public function package(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Package::class);
|
||||
return $this->belongsTo(Package::class)->withTrashed();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -85,7 +85,7 @@ class CheckoutSession extends Model
|
||||
|
||||
public function package(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Package::class);
|
||||
return $this->belongsTo(Package::class)->withTrashed();
|
||||
}
|
||||
|
||||
public function scopeActive($query)
|
||||
|
||||
@@ -39,7 +39,7 @@ class EventPackage extends Model
|
||||
|
||||
public function package(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Package::class);
|
||||
return $this->belongsTo(Package::class)->withTrashed();
|
||||
}
|
||||
|
||||
public function isActive(): bool
|
||||
|
||||
@@ -6,10 +6,12 @@ use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||
|
||||
class Package extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use SoftDeletes;
|
||||
|
||||
protected $fillable = [
|
||||
'name',
|
||||
|
||||
@@ -46,7 +46,7 @@ class PackagePurchase extends Model
|
||||
|
||||
public function package(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Package::class);
|
||||
return $this->belongsTo(Package::class)->withTrashed();
|
||||
}
|
||||
|
||||
public function isEndcustomerEvent(): bool
|
||||
|
||||
@@ -222,7 +222,7 @@ class Tenant extends Model
|
||||
public function getActiveResellerPackage(): ?TenantPackage
|
||||
{
|
||||
return $this->activeResellerPackage()
|
||||
->whereHas('package', fn ($query) => $query->where('type', 'reseller'))
|
||||
->whereHas('package', fn ($query) => $query->withTrashed()->where('type', 'reseller'))
|
||||
->where('active', true)
|
||||
->orderByDesc('expires_at')
|
||||
->first();
|
||||
|
||||
@@ -44,7 +44,7 @@ class TenantPackage extends Model
|
||||
|
||||
public function package(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(Package::class);
|
||||
return $this->belongsTo(Package::class)->withTrashed();
|
||||
}
|
||||
|
||||
public function isActive(): bool
|
||||
|
||||
Reference in New Issue
Block a user