First complete upload CasaDoc
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace Vanguard\Repositories\Country;
|
||||
|
||||
interface CountryRepository
|
||||
{
|
||||
/**
|
||||
* Create $key => $value array for all available countries.
|
||||
*
|
||||
* @param string $column
|
||||
* @param string $key
|
||||
* @return mixed
|
||||
*/
|
||||
public function lists($column = 'name', $key = 'id');
|
||||
|
||||
/**
|
||||
* Get all available countries.
|
||||
* @return mixed
|
||||
*/
|
||||
public function all();
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace Vanguard\Repositories\Country;
|
||||
|
||||
use Vanguard\Country;
|
||||
|
||||
class EloquentCountry implements CountryRepository
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function lists($column = 'name', $key = 'id')
|
||||
{
|
||||
return Country::orderBy('name')->pluck($column, $key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
return Country::all();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user