<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class GuidePageEdge extends Model
{
    protected $fillable = [
        'guide_id',
        'from_page_id',
        'to_page_id',
        'label',
        'sort',
    ];

    public function guide()
    {
        return $this->belongsTo(Guide::class);
    }

    public function fromPage()
    {
        return $this->belongsTo(GuidePage::class, 'from_page_id');
    }

    public function toPage()
    {
        return $this->belongsTo(GuidePage::class, 'to_page_id');
    }
}
