<?php

namespace App\Http\Controllers\Frontend;

use Exception;
use App\Services\AboutUsService;
use App\Http\Controllers\Controller;
use App\Http\Resources\AboutUsResource;

class AboutUsController extends Controller
{
    private AboutUsService $aboutUsService;

    public function __construct(AboutUsService $banner)
    {
        $this->aboutUsService = $banner;
    }

    public function index()
    {
        try {
            return new AboutUsResource($this->aboutUsService->list());
        } catch (Exception $exception) {
            return response(['status' => false, 'message' => $exception->getMessage()], 422);
        }
    }
}