Some checks failed
continuous-integration/drone/push Build is failing
- Complete GGZ Ecademy Laravel backend application - RESTful API for learning products, members, filters - Authentication and authorization system - Database migrations and seeders - Custom CRUD generator commands - Email notification system - Integration with frontend applications
44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Http\Requests\ChecklistCategoryRequest;
|
|
use App\Services\ChecklistCategoryService;
|
|
|
|
class ChecklistCategoryController extends Controller
|
|
{
|
|
|
|
private $checklistCategoryService;
|
|
|
|
public function __construct(ChecklistCategoryService $checklistCategoryService)
|
|
{
|
|
$this->checklistCategoryService = $checklistCategoryService;
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$checklistCategories = $this->checklistCategoryService->with(['items']);
|
|
|
|
return response()->json($checklistCategories, 201);
|
|
}
|
|
|
|
public function store(ChecklistCategoryRequest $request)
|
|
{
|
|
$checklistcategory = $this->checklistCategoryService->save($request->all());
|
|
|
|
return response()->json($checklistcategory, 201);
|
|
}
|
|
|
|
public function show($id)
|
|
{
|
|
$checklistcategory = $this->checklistCategoryService->get($id);
|
|
|
|
return response()->json($checklistcategory);
|
|
}
|
|
|
|
public function destroy($id)
|
|
{
|
|
$this->checklistCategoryService->delete($id);
|
|
return response()->json(null, 204);
|
|
}
|
|
} |