<?php

namespace App\Models;

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

class MetroNode extends Model
{
    use HasFactory;

    protected $table = 'metro_nodes';

    protected $fillable = [
        'metro_line_id',
        'naam',
        'beschrijving',
        'status',
        'x',
        'y',
        'order',
        'eigenaar_id',
    ];

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

    public function eigenaar(): BelongsTo
    {
        return $this->belongsTo(User::class, 'eigenaar_id');
    }
}
