60 lines
1.3 KiB
PHP
60 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Cadastro\Fabricante;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Models\Cadastro\Fabricante;
|
|
use App\Services\Cadastro\Fabricante\FabricanteService;
|
|
use Illuminate\Http\Response;
|
|
|
|
class FabricanteController extends Controller
|
|
{
|
|
protected $modulo = 'cadastro';
|
|
protected $funcionalidade = 'fabricante';
|
|
|
|
public function autocomplete()
|
|
{
|
|
return FabricanteService::autocomplete();
|
|
}
|
|
|
|
public function datatable()
|
|
{
|
|
return FabricanteService::datatable();
|
|
}
|
|
|
|
public function create()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(FabricanteService::create(), Response::HTTP_OK);
|
|
}
|
|
|
|
public function store()
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(FabricanteService::store(), Response::HTTP_CREATED);
|
|
}
|
|
|
|
public function edit($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(FabricanteService::edit($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function update($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(FabricanteService::update($id), Response::HTTP_OK);
|
|
}
|
|
|
|
public function destroy($id)
|
|
{
|
|
$this->auth(__FUNCTION__);
|
|
|
|
return response()->json(FabricanteService::destroy($id), Response::HTTP_NO_CONTENT);
|
|
}
|
|
}
|