From 6a72aef110fff379ebf96d2d6330ede49966ce26 Mon Sep 17 00:00:00 2001 From: Remco Date: Mon, 19 Jan 2026 20:46:38 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=86=99=20More=20fixes=20=F0=9F=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../app/Models/Shop/WebsitePaypalTransaction.php | 3 +++ Updated_Cms/app/Models/Shop/WebsiteShopArticle.php | 14 ++++++++++++++ .../app/Models/Shop/WebsiteShopArticleFeature.php | 3 +++ .../app/Models/Shop/WebsiteShopCategory.php | 3 +++ .../app/Models/Shop/WebsiteUsedShopVoucher.php | 3 +++ Updated_Cms/app/Models/WebsiteAd.php | 2 +- 6 files changed, 27 insertions(+), 1 deletion(-) diff --git a/Updated_Cms/app/Models/Shop/WebsitePaypalTransaction.php b/Updated_Cms/app/Models/Shop/WebsitePaypalTransaction.php index ad1fcd3ad3..0f5fc60971 100644 --- a/Updated_Cms/app/Models/Shop/WebsitePaypalTransaction.php +++ b/Updated_Cms/app/Models/Shop/WebsitePaypalTransaction.php @@ -10,6 +10,9 @@ class WebsitePaypalTransaction extends Model { protected $guarded = ['id', 'created_at', 'updated_at']; + /** + * @return BelongsTo + */ public function user(): BelongsTo { return $this->belongsTo(User::class); diff --git a/Updated_Cms/app/Models/Shop/WebsiteShopArticle.php b/Updated_Cms/app/Models/Shop/WebsiteShopArticle.php index fe22e6f949..4a9088c1fd 100644 --- a/Updated_Cms/app/Models/Shop/WebsiteShopArticle.php +++ b/Updated_Cms/app/Models/Shop/WebsiteShopArticle.php @@ -13,6 +13,9 @@ class WebsiteShopArticle extends Model { protected $guarded = ['id']; + /** + * @return Collection + */ public function furniItems(): Collection { if (! $this->furniture) { @@ -20,16 +23,27 @@ class WebsiteShopArticle extends Model } $furniture = json_decode($this->furniture, true); + + if (! is_array($furniture)) { + return collect(); + } + $furnitureIds = array_column($furniture, 'item_id'); return ItemBase::whereIn('id', $furnitureIds)->get(); } + /** + * @return HasOne + */ public function rank(): HasOne { return $this->hasOne(Permission::class, 'id', 'give_rank'); } + /** + * @return HasMany + */ public function features(): HasMany { return $this->HasMany(WebsiteShopArticleFeature::class, 'article_id', 'id'); diff --git a/Updated_Cms/app/Models/Shop/WebsiteShopArticleFeature.php b/Updated_Cms/app/Models/Shop/WebsiteShopArticleFeature.php index 9551d3adce..968f144731 100644 --- a/Updated_Cms/app/Models/Shop/WebsiteShopArticleFeature.php +++ b/Updated_Cms/app/Models/Shop/WebsiteShopArticleFeature.php @@ -9,6 +9,9 @@ class WebsiteShopArticleFeature extends Model { protected $guarded = ['id']; + /** + * @return BelongsTo + */ public function article(): BelongsTo { return $this->belongsTo(WebsiteShopArticle::class, 'article_id', 'id'); diff --git a/Updated_Cms/app/Models/Shop/WebsiteShopCategory.php b/Updated_Cms/app/Models/Shop/WebsiteShopCategory.php index cb5af56dd2..754c774ac7 100644 --- a/Updated_Cms/app/Models/Shop/WebsiteShopCategory.php +++ b/Updated_Cms/app/Models/Shop/WebsiteShopCategory.php @@ -9,6 +9,9 @@ class WebsiteShopCategory extends Model { protected $guarded = []; + /** + * @return HasMany + */ public function articles(): HasMany { return $this->hasMany(WebsiteShopArticle::class); diff --git a/Updated_Cms/app/Models/Shop/WebsiteUsedShopVoucher.php b/Updated_Cms/app/Models/Shop/WebsiteUsedShopVoucher.php index 83e6ec010b..1476981b9d 100644 --- a/Updated_Cms/app/Models/Shop/WebsiteUsedShopVoucher.php +++ b/Updated_Cms/app/Models/Shop/WebsiteUsedShopVoucher.php @@ -9,6 +9,9 @@ class WebsiteUsedShopVoucher extends Model { protected $guarded = ['id']; + /** + * @return HasMany + */ public function used(): HasMany { return $this->hasMany(WebsiteUsedShopVoucher::class, 'voucher_id'); diff --git a/Updated_Cms/app/Models/WebsiteAd.php b/Updated_Cms/app/Models/WebsiteAd.php index 39251dc92e..cdb00c5d25 100644 --- a/Updated_Cms/app/Models/WebsiteAd.php +++ b/Updated_Cms/app/Models/WebsiteAd.php @@ -29,7 +29,7 @@ class WebsiteAd extends Model $adsPicturePath = Cache::remember('ads_picture_path', 3600, fn () => $settingsService->getOrDefault('ads_picture_path')); if (! str_starts_with($adsPicturePath, 'http')) { - $adsPicturePath = rtrim((string) config('app.url'), '/') . '/' . ltrim($adsPicturePath, '/'); + $adsPicturePath = rtrim((string) (config('app.url') ?? ''), '/') . '/' . ltrim($adsPicturePath, '/'); } return rtrim($adsPicturePath, '/') . '/' . $this->image; });