33 lines
725 B
PHP
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();
|
|
}
|
|
}
|