Add country name when filtering by country name
All checks were successful
/ deploy-job (push) Successful in 0s
All checks were successful
/ deploy-job (push) Successful in 0s
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
namespace Krzysiej\RyobiCrawler\Controller;
|
namespace Krzysiej\RyobiCrawler\Controller;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Krzysiej\RyobiCrawler\Models\Country;
|
||||||
use Krzysiej\RyobiCrawler\Models\Product;
|
use Krzysiej\RyobiCrawler\Models\Product;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\Routing\Attribute\Route;
|
use Symfony\Component\Routing\Attribute\Route;
|
||||||
@@ -20,6 +21,8 @@ final class CountryController extends BaseController
|
|||||||
->orderByDesc('created_by')
|
->orderByDesc('created_by')
|
||||||
->get();
|
->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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,10 @@
|
|||||||
</ul>
|
</ul>
|
||||||
{% endif %}
|
{% 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) %}
|
{% 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">
|
<div class="table-responsive">
|
||||||
|
|||||||
Reference in New Issue
Block a user