You've already forked Epicnabbo-Catalogus-Updated-Daily
🆙 More fixes 🆙
This commit is contained in:
@@ -10,6 +10,9 @@ class WebsitePaypalTransaction extends Model
|
|||||||
{
|
{
|
||||||
protected $guarded = ['id', 'created_at', 'updated_at'];
|
protected $guarded = ['id', 'created_at', 'updated_at'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return BelongsTo<User, $this>
|
||||||
|
*/
|
||||||
public function user(): BelongsTo
|
public function user(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(User::class);
|
return $this->belongsTo(User::class);
|
||||||
|
|||||||
@@ -13,6 +13,9 @@ class WebsiteShopArticle extends Model
|
|||||||
{
|
{
|
||||||
protected $guarded = ['id'];
|
protected $guarded = ['id'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return Collection<int, ItemBase>
|
||||||
|
*/
|
||||||
public function furniItems(): Collection
|
public function furniItems(): Collection
|
||||||
{
|
{
|
||||||
if (! $this->furniture) {
|
if (! $this->furniture) {
|
||||||
@@ -20,16 +23,27 @@ class WebsiteShopArticle extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
$furniture = json_decode($this->furniture, true);
|
$furniture = json_decode($this->furniture, true);
|
||||||
|
|
||||||
|
if (! is_array($furniture)) {
|
||||||
|
return collect();
|
||||||
|
}
|
||||||
|
|
||||||
$furnitureIds = array_column($furniture, 'item_id');
|
$furnitureIds = array_column($furniture, 'item_id');
|
||||||
|
|
||||||
return ItemBase::whereIn('id', $furnitureIds)->get();
|
return ItemBase::whereIn('id', $furnitureIds)->get();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return HasOne<Permission, $this>
|
||||||
|
*/
|
||||||
public function rank(): HasOne
|
public function rank(): HasOne
|
||||||
{
|
{
|
||||||
return $this->hasOne(Permission::class, 'id', 'give_rank');
|
return $this->hasOne(Permission::class, 'id', 'give_rank');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return HasMany<WebsiteShopArticleFeature, $this>
|
||||||
|
*/
|
||||||
public function features(): HasMany
|
public function features(): HasMany
|
||||||
{
|
{
|
||||||
return $this->HasMany(WebsiteShopArticleFeature::class, 'article_id', 'id');
|
return $this->HasMany(WebsiteShopArticleFeature::class, 'article_id', 'id');
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ class WebsiteShopArticleFeature extends Model
|
|||||||
{
|
{
|
||||||
protected $guarded = ['id'];
|
protected $guarded = ['id'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return BelongsTo<WebsiteShopArticle, $this>
|
||||||
|
*/
|
||||||
public function article(): BelongsTo
|
public function article(): BelongsTo
|
||||||
{
|
{
|
||||||
return $this->belongsTo(WebsiteShopArticle::class, 'article_id', 'id');
|
return $this->belongsTo(WebsiteShopArticle::class, 'article_id', 'id');
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ class WebsiteShopCategory extends Model
|
|||||||
{
|
{
|
||||||
protected $guarded = [];
|
protected $guarded = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return HasMany<WebsiteShopArticle, $this>
|
||||||
|
*/
|
||||||
public function articles(): HasMany
|
public function articles(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(WebsiteShopArticle::class);
|
return $this->hasMany(WebsiteShopArticle::class);
|
||||||
|
|||||||
@@ -9,6 +9,9 @@ class WebsiteUsedShopVoucher extends Model
|
|||||||
{
|
{
|
||||||
protected $guarded = ['id'];
|
protected $guarded = ['id'];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return HasMany<WebsiteUsedShopVoucher, $this>
|
||||||
|
*/
|
||||||
public function used(): HasMany
|
public function used(): HasMany
|
||||||
{
|
{
|
||||||
return $this->hasMany(WebsiteUsedShopVoucher::class, 'voucher_id');
|
return $this->hasMany(WebsiteUsedShopVoucher::class, 'voucher_id');
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ class WebsiteAd extends Model
|
|||||||
$adsPicturePath = Cache::remember('ads_picture_path', 3600, fn () => $settingsService->getOrDefault('ads_picture_path'));
|
$adsPicturePath = Cache::remember('ads_picture_path', 3600, fn () => $settingsService->getOrDefault('ads_picture_path'));
|
||||||
|
|
||||||
if (! str_starts_with($adsPicturePath, 'http')) {
|
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;
|
return rtrim($adsPicturePath, '/') . '/' . $this->image;
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user