Trae todos los productos por defecto
This commit is contained in:
parent
a512f8e162
commit
b490cd8b25
1 changed files with 1 additions and 2 deletions
|
@ -15,7 +15,6 @@ use Illuminate\Support\Facades\DB;
|
||||||
class Producto extends Model
|
class Producto extends Model
|
||||||
{
|
{
|
||||||
protected $fillable = ["nombre", "precio", "categoria"];
|
protected $fillable = ["nombre", "precio", "categoria"];
|
||||||
static int $paginarPorDefecto = 10;
|
|
||||||
|
|
||||||
public function subpedidos(): BelongsToMany
|
public function subpedidos(): BelongsToMany
|
||||||
{
|
{
|
||||||
|
@ -30,7 +29,7 @@ class Producto extends Model
|
||||||
|
|
||||||
public static function getPaginar(Request $request): int
|
public static function getPaginar(Request $request): int
|
||||||
{
|
{
|
||||||
return $request->has('paginar') && intval($request->input('paginar')) ? intval($request->input('paginar')) : self::$paginarPorDefecto;
|
return $request->has('paginar') && intval($request->input('paginar')) ? intval($request->input('paginar')) : self::all()->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function productosFilaID()
|
public static function productosFilaID()
|
||||||
|
|
Loading…
Add table
Reference in a new issue