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
931 B
PHP
44 lines
931 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\Http\Requests\ChecklistRequest;
|
|
use App\Services\ChecklistService;
|
|
|
|
class ChecklistController extends Controller
|
|
{
|
|
|
|
private $checklistService;
|
|
|
|
public function __construct(ChecklistService $checklistService)
|
|
{
|
|
$this->checklistService = $checklistService;
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$checklists = $this->checklistService->getAll();
|
|
|
|
return response()->json($checklists, 201);
|
|
}
|
|
|
|
public function store(ChecklistRequest $request)
|
|
{
|
|
$checklist = $this->checklistService->save($request->all());
|
|
|
|
return response()->json($checklist, 201);
|
|
}
|
|
|
|
public function show($id)
|
|
{
|
|
$checklist = $this->checklistService->get($id);
|
|
|
|
return response()->json($checklist);
|
|
}
|
|
|
|
public function destroy($id)
|
|
{
|
|
$this->checklistService->delete($id);
|
|
return response()->json(null, 204);
|
|
}
|
|
} |