first commit

This commit is contained in:
2025-03-22 16:41:26 +01:00
commit 55ccbe3ad4
746 changed files with 89584 additions and 0 deletions
@@ -0,0 +1,22 @@
<?php
namespace Vanguard\Repositories\Country;
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
use Illuminate\Support\Collection;
use Vanguard\Country;
interface CountryRepository
{
/**
* Create $key => $value array for all available countries.
*/
public function lists(string $column = 'name', string $key = 'id'): Collection;
/**
* Get all available countries.
*
* @return EloquentCollection<Country>
*/
public function all(): EloquentCollection;
}
@@ -0,0 +1,26 @@
<?php
namespace Vanguard\Repositories\Country;
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
use Illuminate\Support\Collection;
use Vanguard\Country;
class EloquentCountry implements CountryRepository
{
/**
* {@inheritdoc}
*/
public function lists($column = 'name', $key = 'id'): Collection
{
return Country::orderBy('name')->pluck($column, $key);
}
/**
* {@inheritdoc}
*/
public function all(): EloquentCollection
{
return Country::all();
}
}