<?php

namespace App\Models;

use App\Traits\Image;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;

class MenyuGallery extends Model
{
    use HasFactory, Image;

    protected $fillable = [
        'menyu_id',
        'partners'
    ];

    public function menyu(): BelongsTo
    {
        return $this->belongsTo(Menyu::class);
    }
    public function partners() :?string
    {
        return $this->getAttribute("partners") ? asset('/storage/images/' . $this->getAttribute("partners")) : null;
    }
}
