HEX
Server: LiteSpeed
System: Linux s1049.use1.mysecurecloudhost.com 4.18.0-477.27.2.lve.el8.x86_64 #1 SMP Wed Oct 11 12:32:56 UTC 2023 x86_64
User: xedaptot (3356)
PHP: 8.3.31
Disabled: NONE
Upload Files
File: /home/xedaptot/ai.naniguide.com/app/Model/AdProduct.php
<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

/**
 * @property int $id
 * @property int $ad_product_catalog_id
 * @property string|null $external_id
 * @property string $title
 * @property string|null $description
 * @property string $price
 * @property string|null $sale_price
 * @property string $currency
 * @property string|null $image_url
 * @property string|null $url
 * @property string $availability
 * @property string|null $category
 * @property string|null $brand
 * @property array<string,mixed>|null $custom
 * @property array<string,string>|null $platform_retailer_ids
 * @property \Illuminate\Support\Carbon|null $last_synced_at
 * @property string|null $last_sync_error
 */
class AdProduct extends Model
{
    protected $table = 'ad_products';

    protected $fillable = [
        'ad_product_catalog_id',
        'external_id',
        'title',
        'description',
        'price',
        'sale_price',
        'currency',
        'image_url',
        'url',
        'availability',
        'category',
        'brand',
        'custom',
        'platform_retailer_ids',
        'last_synced_at',
        'last_sync_error',
    ];

    protected $casts = [
        'custom' => 'json',
        'platform_retailer_ids' => 'json',
        'last_synced_at' => 'datetime',
        'price' => 'decimal:2',
        'sale_price' => 'decimal:2',
    ];

    /**
     * @return BelongsTo<AdProductCatalog, $this>
     */
    public function catalog(): BelongsTo
    {
        return $this->belongsTo(AdProductCatalog::class, 'ad_product_catalog_id');
    }
}