2022-01-05 18:14:21 -03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Api;
|
|
|
|
|
|
|
|
use App\Http\Controllers\Controller;
|
|
|
|
use Illuminate\Http\Request;
|
2022-01-07 18:02:48 -03:00
|
|
|
use App\Filtros\FiltroDeProducto;
|
2022-01-05 18:14:21 -03:00
|
|
|
use App\Producto;
|
|
|
|
|
|
|
|
class ProductoController extends Controller
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Mostrar una lista de productos.
|
|
|
|
*
|
2022-01-07 18:02:48 -03:00
|
|
|
* @param App\Filtros\FiltroDeProducto $filtros
|
2022-01-05 18:14:21 -03:00
|
|
|
* @param \Illuminate\Http\Request $request
|
|
|
|
* @return \Illuminate\Http\Response
|
|
|
|
*/
|
2022-01-07 18:02:48 -03:00
|
|
|
public function index(FiltroDeProducto $filtros, Request $request)
|
2022-01-05 18:14:21 -03:00
|
|
|
{
|
|
|
|
return Producto::filtrar($filtros)->paginate(Producto::getPaginar($request));
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|