<?php

namespace App\Http\Controllers\Web;

use App\Models\Article;
use App\Models\Category;
use App\Models\Country;
use App\Models\City;
use App\Models\Facility;
use App\Models\Faq;
use App\Models\Gallery;
use App\Http\Requests\Web\CustomerCareRequest;
use App\Models\Page;
use App\Models\VisitorMessage;
use App\Models\WebsiteVisitor;
use Illuminate\Http\Request;
use Illuminate\View\View;
use App\Http\Controllers\Controller;

class CustomerCareController extends Controller
{
    private $view = 'web.pages.customer_care.';

    /**
     * Create a new controller instance.
     *
     * @return void
     */
    public function __construct()
    {
        // $this->middleware('auth')->except('lang');
    }

    /**
     * Show the application dashboard.
     * @return View
     */

    public function index(Request $request)
    {
        $title = __('web.customer_care');
        $pages = Page::withDescription()->find([13,14]);
        $image = asset($pages[0]->image);
        $faqs = Faq::withDescription()->cursor();

        return view($this->view.'index', get_defined_vars());
    }

    public function store(CustomerCareRequest $request)
    {
        VisitorMessage::create($request->all());
        return response()->json(['message'=> __('web.success'),'data'=>url()->previous()]);
    }



}
