<?php

namespace App\Http\Controllers\Web;

use App\Article;
use App\Consultation;
use App\Consulting;
use App\Helpers\ImageHelper;
use App\Http\Controllers\Controller;
use App\Http\Requests\ConsultationRequest;
use App\Http\Requests\ConsultingRequest;
use App\Http\Requests\JobRequest;
use App\JobApplication;
use App\Page;
use App\Speciality;
use Illuminate\View\View;

class ConsultationController extends Controller
{
    private $view = 'web.consultations.';

    /**
     * Show the application dashboard.
     * @param null $hash
     * @return View
     */
    public function index(): View
    {
        $consultationPage = Page::details(3);
        $title = $consultationPage->title ?? __('services.head');
        $keywords= $consultationPage->keywords ??__('services.head');
        $meta_description = $consultationPage->meta_description ??__('services.head');

        $consultings = Consulting::withDescription();

        return view($this->view.'index', compact('consultationPage', 'consultings', 'title', 'keywords', 'meta_description'));
    }

    public function store(ConsultationRequest $request)
    {
        Consultation::create($request->all());
        return response()->json(['message' => __('consultations.consultation_successfully')]);

    }
}
