Add twig extra bundle to use currency formatter filter. Add custom twig method to display number of active promos. Remove old index.php file.

This commit is contained in:
Krzysztof Płaczek
2024-11-17 12:33:40 +01:00
parent f1c0ec6b3a
commit 48ee68f71a
9 changed files with 264 additions and 60 deletions

View File

@@ -2,7 +2,6 @@
namespace Krzysiej\RyobiCrawler\Controller;
use Illuminate\Support\ItemNotFoundException;
use Krzysiej\RyobiCrawler\Models\Product;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
@@ -21,7 +20,8 @@ final class ProductController extends BaseController
public function __invoke(int $productId): Response
{
$product = Product::with([
'price' => fn($query) => $query->orderBy('created_at', 'desc')
'price' => fn($query) => $query->orderBy('created_at', 'desc'),
'stock' => fn($query) => $query->orderBy('created_at', 'desc'),
])->find($productId);
if(null === $product) {