<?php

namespace Modules\Area\Controllers\Store;

/** Ajax Request */

use App\Services\Response\ResponseService;
use Exception;
use Illuminate\View\View;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use Illuminate\Routing\Redirector;
use Illuminate\Http\RedirectResponse;
use App\Http\Controllers\Controller;
use Modules\Area\Models\Area;
use Modules\Area\Requests\Admin\AreaRequest;
use Modules\Area\Services\AreaService;
use Modules\City\Services\CityService;
use Modules\Region\Services\RegionService;

class AreaController extends Controller
{

    private $viewDirectory= 'store.branch.';
    //
    private AreaService $areaService;

    public function __construct(AreaService $areaService)
    {
        $this->areaService = $areaService;
    }

    /**
     * Display a listing of the areas.
     *
     * @param Request $request
     * @return View
     */
    public function areas(Request $request) :View
    {
        $areas= $this->areaService->get($request);
        return view($this->viewDirectory.'areas', get_defined_vars());
    }

}
