41 lines
989 B
PHP
41 lines
989 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api\V1\Access;
|
|
|
|
use App\Constant\Constant;
|
|
use Illuminate\Support\Facades\Log;
|
|
use App\Http\Controllers\Api\ApiController;
|
|
use App\Repositories\Api\Access\Country\CountryInterface as CountryRepository;
|
|
|
|
class CountryController extends ApiController
|
|
{
|
|
/**
|
|
* @param CountryRepository $countryRepository
|
|
* CountryController constructor.
|
|
*
|
|
*/
|
|
public function __construct(CountryRepository $countryRepository)
|
|
{
|
|
$this->countryRepository = $countryRepository;
|
|
}
|
|
|
|
/**
|
|
* @return array
|
|
*/
|
|
public function getCountryCodeList()
|
|
{
|
|
$response = [];
|
|
|
|
try {
|
|
$response = $this->countryRepository->getCountryCodeList();
|
|
$this->setStatusCode($response['status']);
|
|
|
|
} catch (\Exception $ex) {
|
|
Log::error($ex);
|
|
$this->setStatusCode(Constant::CODE_403);
|
|
}
|
|
|
|
return $this->respond($response);
|
|
}
|
|
}
|