pai-sklep/app/Http/Controllers/MainPageController.php

16 lines
306 B
PHP
Raw Normal View History

2021-11-14 20:44:10 +01:00
<?php
namespace App\Http\Controllers;
use App\Models\Product;
use Illuminate\Http\Request;
class MainPageController extends Controller
{
2021-11-24 11:34:46 +01:00
public function index()
{
2021-11-14 20:44:10 +01:00
$products = Product::query()->latest()->limit(100)->get();
return view("index", ["products" => $products]);
}
}