Author: Paulius Leveris
According to given flight data, script should determine if the flight is claimable or not based on specified conditions.
- OS: Ubuntu 20.04;
- PHP v8;
- Laravel v10.
First, ensure the following Dependencies are available on your system:
- Docker;
- Docker Compose;
- PHP 8.2;
- Composer.
Clone the project from GitHub:
git clone --recursive https://github.com/pleveris/decision-table-implementation.git
Install Composer Dependencies:
composer install
Change .env.example to .env, edit all the credentials that suits your needs:
cp .env.example .env
To build a Docker container, run:
./vendor/bin/sail build --no-cache
Set the application key:
./vendor/bin/sail artisan key:generate
Start the container:
./vendor/bin/sail up
The application should be available at localhost:80.
It's defined as a CLI command, and can be run by typing in the console:
./vendor/bin/sail artisan process:flights <path_to_project>/flights.csv
Here, <path_to_project> means the original path to the project, e.g. /home/<user>/development/decision-table-implementation/
.
If you do not have Docker installed and/or configured, you can run the script locally: Set the application key:
php artisan key:generate
Start the development server:
php artisan serve
To launch the flight claim script, run:
php artisan process:flights flights.csv