<?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 ProjectGallery extends Model
{
    use HasFactory, Image;

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

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