This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Intranet\Cadastro;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Services\Intranet\Cadastro\NotaVersaoService;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class NotaVersaoController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return response()->json(NotaVersaoService::index(), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
20
api/app/Http/Controllers/Intranet/ClienteController.php
Normal file
20
api/app/Http/Controllers/Intranet/ClienteController.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Intranet;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Intranet\Cliente;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class ClienteController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$cliente = $this->get(Cliente::class)
|
||||
->where('link', request()->get('link'))
|
||||
->orderBy('nome')
|
||||
->first();
|
||||
|
||||
return response()->json($cliente, Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
43
api/app/Http/Controllers/Intranet/MunicipioController.php
Normal file
43
api/app/Http/Controllers/Intranet/MunicipioController.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Intranet;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Intranet\Municipio;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class MunicipioController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$municipios = $this->get(Municipio::class)
|
||||
->where($this->getWhereFromQueryString(['estado_id', 'nome']))
|
||||
->orderBy('nome')
|
||||
->get();
|
||||
|
||||
return response()->json($municipios, Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
return response()->json($this->get(Municipio::class, $id), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
|
||||
public function autocomplete()
|
||||
{
|
||||
$municipios = Municipio::with([]);
|
||||
|
||||
if (is_numeric(request()->estado_id)) {
|
||||
|
||||
$municipios->where('estado_id', request()->estado_id);
|
||||
}
|
||||
|
||||
if (is_numeric(request()->not_municipio_id)) {
|
||||
|
||||
$municipios->where('id', '<>', request()->not_municipio_id);
|
||||
}
|
||||
|
||||
return datatables()->of($municipios)->toJson();
|
||||
}
|
||||
}
|
||||
20
api/app/Http/Controllers/Intranet/PaisController.php
Normal file
20
api/app/Http/Controllers/Intranet/PaisController.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Intranet;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Intranet\Pais;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class PaisController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
return response()->json($this->get(Pais::class)->orderBy('nome')->get(), Response::HTTP_OK);
|
||||
}
|
||||
|
||||
public function show($id)
|
||||
{
|
||||
return response()->json($this->get(Pais::class, $id), Response::HTTP_OK);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user