<?php

namespace Bongo\Builder\Http\Controllers\Api;

use Bongo\Menu\Models\Menu;
use Bongo\Framework\Http\Controllers\AbstractApiController;
use Illuminate\Http\Request;

class MenuController extends AbstractApiController
{
    public function index(Request $request)
    {
        return view('builder::api.menu_builder')
            ->with([
                'menu' => Menu::with('items')
                    ->where('uuid', $request->get('ref'))
                    ->first(),
            ])
            ->render();
    }
}
