This commit is contained in:
55
api/app/Http/Controllers/Ambulatorio/ServicoController.php
Normal file
55
api/app/Http/Controllers/Ambulatorio/ServicoController.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user