<?php

namespace Modules\Task\Http\Controllers\Api;

use App\Api\Controllers\Controller;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Modules\Task\Http\Resources\CategoryResource;
use Modules\Task\Models\Category;

class CategoryController extends Controller
{

    public function index(Request $request): JsonResponse
    {
        $tasks = Category::Shown()->get();

        return $this->success(CategoryResource::collection($tasks));
    }

}
