72 lines
1.5 KiB
PHP
72 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Cadastro;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\Cadastro\FeridaService;
|
|
use Illuminate\Http\Response;
|
|
|
|
class FeridaController extends Controller
|
|
{
|
|
protected $modulo = 'cadastro';
|
|
protected $funcionalidade = 'ferida';
|
|
|
|
public function datatable()
|
|
{
|
|
return datatables()
|
|
->of(FeridaService::datatable())
|
|
->toJson();
|
|
}
|
|
|
|
public function create()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(FeridaService::create(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function store()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(FeridaService::store(), Response::HTTP_CREATED);
|
|
}
|
|
|
|
public function edit($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(FeridaService::edit($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function update($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(FeridaService::update($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function activate($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(FeridaService::activate($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function deactivate($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(FeridaService::deactivate($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function destroy($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
FeridaService::destroy($id);
|
|
|
|
return response()->noContent();
|
|
}
|
|
}
|