<?php

namespace App\Http\Controllers\Web;

use App\Branch;
use App\Http\Controllers\Controller;
use App\Http\Requests\Web\VisitorMessageRequest;
use App\VisitorMessage;
use Illuminate\Http\JsonResponse;

class VisitorMessageController extends Controller
{

    private $view = 'web.contact_us.';


    public function index()
    {
        $title = __('visitorMessages.head');
        return view( $this->view.'index', get_defined_vars());
    }

    public function store(VisitorMessageRequest $request) :JsonResponse
    {
        VisitorMessage::create($request->all());
        return response()->json(['message' => __('visitorMessages.message_success')]);
    }
}
