This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\TransportePaciente\Condutor;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\TransportePaciente\Condutor\CondutorService;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class CondutorController extends Controller
|
||||
{
|
||||
protected $modulo = 'transporte-paciente';
|
||||
protected $funcionalidade = 'condutor';
|
||||
|
||||
public function create()
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(CondutorService::create(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(CondutorService::store($request), Response::HTTP_CREATED);
|
||||
}
|
||||
|
||||
public function datatable()
|
||||
{
|
||||
return CondutorService::datatable()->skipTotalRecords()->toJson();
|
||||
}
|
||||
|
||||
public function edit($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(CondutorService::edit($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(CondutorService::update($request, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function bloquear($id)
|
||||
{
|
||||
return response()->json(CondutorService::bloquear($id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->auth(__FUNCTION__);
|
||||
|
||||
return response()->json(CondutorService::destroy($id), Response::HTTP_NO_CONTENT);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user