<?php

namespace Bongo\Builder\Http\Controllers\Api;

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

class ValidationController extends AbstractApiController
{
    public function index(Request $request)
    {
        $name = 'enquiry';

        if ($request->filled('name') && in_array($request->get('name'), ['enquiry', 'review'])) {
            $name = $request->get('name');
        }

        return view('builder::api.validation')
            ->with([
                'name' => $name,
            ])
            ->render();
    }
}
