Add country name when filtering by country name
All checks were successful
/ deploy-job (push) Successful in 0s

This commit is contained in:
2026-02-23 08:37:12 +01:00
parent 9f322d874e
commit 59f10e620f
2 changed files with 8 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
namespace Krzysiej\RyobiCrawler\Controller;
use Illuminate\Database\Eloquent\Builder;
use Krzysiej\RyobiCrawler\Models\Country;
use Krzysiej\RyobiCrawler\Models\Product;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Attribute\Route;
@@ -20,6 +21,8 @@ final class CountryController extends BaseController
->orderByDesc('created_by')
->get();
return $this->render('productList.html.twig', ['products' => $products, 'listType' => 'country']);
$country = Country::where('countryName', $country)->first();
return $this->render('productList.html.twig', ['products' => $products, 'listType' => 'country', 'country' => $country]);
}
}

View File

@@ -19,6 +19,10 @@
</ul>
{% endif %}
{% if listType == 'country' and country is not null%}
<h2 class="text-muted mt-4 mx-4">{{ country.countryName }}</h2>
{% endif %}
{% if (listType starts with 'category_' and category == null) or not (listType starts with 'category_') or (listType starts with 'category_' and category is not null) %}
<div class="table-responsive">