<?php

namespace App\Http\Controllers\Admin;

use App\Http\Controllers\Controller;
use App\Models\Admin\NavigationMenu;

class NavigationLinkController extends Controller
{
    public function index(int $id)
    {
        $navigationMenu = NavigationMenu::findOrFail($id);

        return view('admin.navigation.link.index', [
            'navigationMenu' => $navigationMenu
        ]);
    }

    public function create(int $id)
    {
        $navigationMenu = NavigationMenu::findOrFail($id);

        return view('admin.navigation.link.create', [
            'navigationMenu' => $navigationMenu
        ]);
    }

    public function edit(int $id, int $link)
    {
        $navigationMenu = NavigationMenu::findOrFail($id);
        $navigationLink = $navigationMenu->links()->findOrFail($link);

        return view('admin.navigation.link.edit', [
            'navigationMenu' => $navigationMenu,
            'navigationLink' => $navigationLink
        ]);
    }
}
