- App receives exchange rate info and stores returned data to the txt file.
- PHP (ver >= 8.1)
- Composer (ver >= 2.2.0)
- Git
- MySQL (OPTIONAL for failed_jobs, ver >= 5.7)
-
git clone https://github.com/shoxrux1996/exchange_rate.git
- clone the project -
$ cp .env.example .env
- copy .env.example to .env file inside root folder -
$ php artisan key:generate
- generate key. -
$ composer install
- installing composer packages. -
OPTIONAL (for failed jobs): Create a database in mysql and update DB credentials in .env
-
OPTIONAL: You can update queue driver to "database", "beanstalkd", "sqs", "redis", "null. By default it's sync
$ php artisan queue:work {quote} {base} {days}
- Call this command to collect the rates with given range of days.
Arguments: quote - Required Quote currency code (ISO 4217 standard).
base - Optional. Base currency code. (ISO 4217 standard). By default it's RUR
days - Optional. Store data with given range of days. By default it's 1, and stores today's rate data.
NOTE: before calling this make sure you have running queue worker. In order to run in you local, call
$ php artisan queue:work
command.
After running $ php artisan app:exchange-rate-data-collection
command, it will store the data inside folder with path: storage/app/Rates/
.
You can also check the output inside storage/logs/laravel.log
file.
- At first we run our queue:
$ php artisan queue:work
- call
$ php artisan app:exchange-rate-data-collection UZS RUR 180
NOTE: This app supports only Base Quote = RUR, it has only have one client Cbr. In order to add more Client, just add your custom client inside
app/Clients
and update the factoryapp/Clients/ClientFactory.php
as well