added countries support
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user