<?php

namespace Beike\Shop\Http\Controllers;

use Beike\Shop\Http\Requests\InquiryRequest;
use Beike\Shop\Services\InquiryService;

class InquiryController extends Controller
{
    public function store(InquiryRequest $request)
    {
        try {
            $requestData = $request->all();

            $data = (new InquiryService)->create($requestData);

            return hook_filter('inquiry.store.data', $data);
        } catch (\Exception $e) {
            return json_fail($e->getMessage());
        }
    }
}
