Files
rkm-conectasus-ci-sandbox/api/app/Http/Controllers/Intranet/EstadoController.php
Antonio Lopes dos Santos afec302c3e
All checks were successful
build-api-image / build (push) Successful in 51s
init commit
2026-08-04 16:52:02 -03:00

33 lines
725 B
PHP

<?php
namespace App\Http\Controllers\Intranet;
use App\Http\Controllers\Controller;
use App\Models\Intranet\Estado;
use Illuminate\Http\Response;
class EstadoController extends Controller
{
public function index()
{
$estados = $this->get(Estado::class)
->where($this->getWhereFromQueryString(['pais_id']))
->orderBy('nome')
->get();
return response()->json($estados, Response::HTTP_OK);
}
public function show($id)
{
return response()->json($this->get(Estado::class, $id), Response::HTTP_OK);
}
public function autocomplete()
{
$estados = Estado::with([]);
return datatables()->of($estados)->toJson();
}
}