This commit is contained in:
32
api/app/Http/Controllers/Intranet/EstadoController.php
Normal file
32
api/app/Http/Controllers/Intranet/EstadoController.php
Normal file
@@ -0,0 +1,32 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user