<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;
use Illuminate\Database\Eloquent\Model;

class BaseProductImage extends Model
{
	use HasDateTimeFormatter;
    protected $table = 'base_product_image';

    protected $casts = [
        'created_at' => 'datetime:Y-m-d H:i:s',
        'updated_at' => 'datetime:Y-m-d H:i:s',
    ];

    // 反向关联，属于某个产品
    public function product()
    {
        return $this->belongsTo(BaseProduct::class, 'id');
    }
}
