<?php

namespace Bongo\Builder\Http\Controllers\Api;

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

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