<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

/**
 * @property int $id
 * @property int $service_package_id
 * @property int $schedule_id
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property-read \App\Models\ServicePackage $servicePackage
 * @property-read \App\Models\Schedule $schedule
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ServicePackageItem newModelQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ServicePackageItem newQuery()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ServicePackageItem query()
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ServicePackageItem whereServicePackageId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ServicePackageItem whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ServicePackageItem whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ServicePackageItem whereScheduleId($value)
 * @method static \Illuminate\Database\Eloquent\Builder<static>|ServicePackageItem whereUpdatedAt($value)
 * @mixin \Eloquent
 */
class ServicePackageItem extends Model
{
    use HasFactory;

    protected $table = 'service_package_items';

    protected $fillable = [
        'service_package_id',
        'schedule_id',
    ];

    protected $casts = [
        'created_at' => 'datetime',
        'updated_at' => 'datetime',
    ];

    public function servicePackage()
    {
        return $this->belongsTo(ServicePackage::class);
    }

    public function schedule()
    {
        return $this->belongsTo(Schedule::class);
    }
}
