Files
Antonio Lopes dos Santos afec302c3e
All checks were successful
build-api-image / build (push) Successful in 51s
init commit
2026-08-04 16:52:02 -03:00

56 lines
1.2 KiB
PHP

<?php
namespace App\Http\Controllers\Ambulatorio;
use App\Http\Controllers\Controller;
use App\Services\Ambulatorio\ServicoService;
use Illuminate\Http\Response;
class ServicoController extends Controller
{
protected $modulo = 'ambulatorio';
protected $funcionalidade = 'servico';
public function datatable()
{
return datatables()->of(ServicoService::datatable())->skipTotalRecords()->toJson();
}
public function create()
{
$this->auth(__FUNCTION__);
return response()->json(ServicoService::create(), Response::HTTP_CREATED);
}
public function edit($id)
{
$this->auth(__FUNCTION__);
return response()->json(ServicoService::edit($id), Response::HTTP_OK);
}
public function store()
{
$this->auth(__FUNCTION__);
return response()->json(ServicoService::store(), Response::HTTP_CREATED);
}
public function update($id)
{
$this->auth(__FUNCTION__);
return response()->json(ServicoService::update($id), Response::HTTP_OK);
}
public function destroy($id)
{
$this->auth(__FUNCTION__);
ServicoService::destroy($id);
return response()->noContent();
}
}