50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Manutencao;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Services\Manutencao\GerenciamentoService;
|
|
use Illuminate\Http\Response;
|
|
|
|
class GerenciamentoController extends Controller
|
|
{
|
|
protected $modulo = 'manutencao';
|
|
protected $funcionalidade = 'gerenciamento';
|
|
|
|
public function datatable()
|
|
{
|
|
return datatables()
|
|
->of(GerenciamentoService::datatable())
|
|
->toJson();
|
|
}
|
|
|
|
public function list()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(GerenciamentoService::list(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function autocompleteUsuarioSolicitante()
|
|
{
|
|
|
|
return datatables()
|
|
->of(GerenciamentoService::autocompleteUsuarioSolicitante())
|
|
->toJson();
|
|
}
|
|
|
|
public function edit($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(GerenciamentoService::edit($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function update($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(GerenciamentoService::update($id), Response::HTTP_OK);
|
|
}
|
|
}
|