<?php

namespace Modules\Partner\Controllers\Web;

/** Ajax Request */

use App\Services\Response\ResponseService;
use Exception;
use Illuminate\View\View;
use Illuminate\Http\Request;
use Illuminate\Http\JsonResponse;
use App\Http\Controllers\Controller;
use Modules\Partner\Requests\Admin\PartnerRequest;
use Modules\Partner\Services\PartnerService;

class PartnerContoller extends Controller
{
    /** View folder */
    private $viewDirectory = 'web.pages.partners.';

    public function __construct(
        private PartnerService $partnerService
    ){}

    public function index()
    {
        $title= __('web.partners');
        $partners = $this->partnerService->get();
        return view($this->viewDirectory.'index', get_defined_vars());
    }

    public function show($id)
    {
        $partner = $this->partnerService->getItem($id);
        if (!$partner)
        {
            return abort(404);
        }
        $title= __('web.partner_details');

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