<?php

namespace App\Models;

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

class PropertyPhotos extends Model
{
    use HasFactory;

    protected $fillable = [
        'id_property',
        'type',
        'file',
        'caption',
        'urutan',
        'is_main',
    ];

    /**
     * Relasi ke Property
     */
    public function property()
    {
        return $this->belongsTo(Property::class, 'id_property')
                    ->withDefault();
    }
}
