<?php

namespace App\Models;

use Illuminate\Bus\Batch;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Facades\Bus;

class BatchMutation extends Model
{
    use HasFactory;

    public $fillable = ['batch_id', 'album_id'];

    public function album() : BelongsTo {
        return $this->belongsTo(Album::class);
    }

    public function getBatchAttribute() : Batch {
        return Bus::findBatch($this->batchId);
    }
}
