<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Work extends Model
{
    protected $guarded = [];

    public function performances()
    {
        return $this->belongsToMany(Performance::class, 'performance_works')->withPivot('act_order', 'notes')->withTimestamps();
    }

    public function performanceWorks()
    {
        return $this->hasMany(PerformanceWork::class);
    }

    public function sources()
    {
        return $this->morphMany(Source::class, 'sourceable');
    }
}
