added countries support

This commit is contained in:
Mark Gregory
2026-06-15 09:05:15 +01:00
parent e91b4251fd
commit 63a9981c7c
21 changed files with 653 additions and 284 deletions
@@ -0,0 +1,20 @@
<?php
namespace Modules\Countries\Support;
use Illuminate\Support\Collection;
use Modules\Countries\Models\Country;
class CountryRepository
{
public function activeForSelect(): Collection
{
return Country::query()->active()->ordered()
->get(['id', 'alpha2', 'alpha3', 'numeric', 'name', 'display_name', 'common_name', 'flag_emoji']);
}
public function findByAlpha2(string $alpha2): ?Country
{
return Country::query()->where('alpha2', strtoupper($alpha2))->first();
}
}