This commit is contained in:
55
api/app/Http/Controllers/Imunizacao/BaixaController.php
Normal file
55
api/app/Http/Controllers/Imunizacao/BaixaController.php
Normal file
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Imunizacao;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Imunizacao\BaixaService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class BaixaController extends Controller
|
||||
{
|
||||
protected $modulo = 'imunizacao';
|
||||
protected $funcionalidade = 'baixa';
|
||||
|
||||
public function index()
|
||||
{
|
||||
return response()->json(BaixaService::index(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(BaixaService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(BaixaService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return datatables()
|
||||
->of(BaixaService::datatable())
|
||||
->filterColumn('cadastro_infraestrutura.nome', function ($query, $keyword) {
|
||||
|
||||
$query->whereRaw("COALESCE(cadastro_infraestrutura.nome, cadastro_unidade.nome_fantasia) like ?", ["%{$keyword}%"]);
|
||||
})
|
||||
->skipTotalRecords()
|
||||
->make(true);
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
return response()->json(BaixaService::list(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function historico()
|
||||
{
|
||||
return response()->json(BaixaService::historico(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user