byhaskell / novaposhta-bundle
Nova Poshta integration bundle for Symfony
Installs: 33
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.1
- symfony/framework-bundle: ^6.4 || ^7.0
- symfony/http-client: ^6.4 || ^7.0
- symfony/http-client-contracts: ^3.0
README
About
Nova Poshta integration bundle for Symfony (6, 7)
Created by @byhaskell
#StandWithUkraine 🇺🇦
What's this?
This library can be used for easy interaction with Nova Poshta.
Installation Symfony Flex
composer require byhaskell/novaposhta-bundle
Installation without Symfony Flex
$bundles = array( // ... other bundles new byhaskell\NovaPoshtaBundle\ByhaskellNovaPoshtaBundle(), );
Configuration
Create new file: config/packages/byhaskell_nova_poshta.yaml
byhaskell_nova_poshta: # You can create one on the Nova Poshta website at: # https://new.novaposhta.ua/dashboard/settings/developers api_key: '%env(NP_API_KEY)%' base_url: 'https://api.novaposhta.ua/v2.0/json/'
Add NP_API_KEY in .env
Usage
public function index(\byhaskell\NovaPoshtaBundle\NovaPoshta $novaPoshta): JsonResponse { $response = $novaPoshta->address()->searchSettlements('Київ'); if ($response->isSuccess()) { /** @var AddressResponse $result */ $result = $response->getResult(); } else { // Errors // $response->getInfo(); // $response->getErrors(); // $response->getWarnings(); } }
Copyright / License
See LICENSE