Skip to content

Commit

Permalink
feat: ability to more advanced use of stored data
Browse files Browse the repository at this point in the history
  • Loading branch information
ospnko committed Jun 6, 2021
1 parent 94f90b8 commit 41169dc
Show file tree
Hide file tree
Showing 11 changed files with 4,368 additions and 72 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vendor/
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,18 @@
This package provides a command for pre-loading Nova Poshta warehouses and class for working with it.

## Usage
## Installation

1. Install package by `composer require scary-layer/nova-poshta`.
1. Add command `php artisan nova-poshta:load` to crontab.
Documentation of Nova Poshta API recommends to do it daily.
If you just started development, run this command single time to warehouses be loaded.
1. Use `ScaryLayer\NovaPoshta\NovaPoshta` class to work with loaded data.
1. Add command `php artisan nova-poshta:load` to crontab.

Documentation of Nova Poshta API recommends to do it daily.

If you just started development, run this command single time to warehouses to be loaded.

## Using
Use `ScaryLayer\NovaPoshta\NovaPoshta` class to work with loaded data.
Currently it contain methods:
- `getCities` - to get array of available cities like [$cityId => $cityName]
- `getWarehouses` - to get array of available warehouses like [$warehouseId => $warehouseName]
If you need to do more advanced work with if, you may just write your own data processor for `storage/app/nova-poshta` json files.
- `getCities` - to get array of available cities like [$cityRef => $cityDescription]
- `getWarehouses` - to get array of available warehouses like [$warehouseRef => $warehouseDescription]

Or you may use `ScaryLayer\NovaPoshta\Repositories\City` and `ScaryLayer\NovaPoshta\Repositories\Warehouse` to more advanced work with stored data.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"extra": {
"laravel": {
"providers": [
"ScaryLayer\\NovaPoshta\\ServiceProvider"
"ScaryLayer\\NovaPoshta\\Providers\\ServiceProvider"
]
}
}
Expand Down
Loading

0 comments on commit 41169dc

Please sign in to comment.