- php:
^8.1
- composer:
^2.0
Install the project install all packages:
composer install
Run the following commands to have a functional project:
cp .env.example .env
php artisan key:generate
php artisan migrate:fresh --seed
To start a local server to process API run the following command
php artisan serve
To run all the tests run the following command:
php artisan test
To check the project's coverage run the following command (xDebug required
):
XDEBUG_MODE=coverage php artisan test --coverage
Laravel Pint is an opinionated PHP code style fixer. To run it:
./vendor/bin/pint --preset laravel
To only check without actually making changes run:
./vendor/bin/pint --preset laravel --test
Rector instantly upgrades and refactors the PHP code.
./vendor/bin/rector
To run it without actually making the changes (for preview), run the following command:
./vendor/bin/rector --dry-run
The business logic and requirements can be found in this document.
Main endpoints can be found here.
Here is a list of endpoints that are available for the API:
POST api/auth ......................................................... AuthController@auth
POST api/travel ..................................... travel.store › TravelController@store
GET|HEAD api/travel/{travel} .............................. travel.show › TravelController@show
PUT|PATCH api/travel/{travel} .......................... travel.update › TravelController@update
DELETE api/travel/{travel} ........................ travel.destroy › TravelController@destroy
POST api/travel/{travel}/tour ..................... tour.store › TravelTourController@store
GET|HEAD api/travel/{travel}/tour .................................. TravelTourController@index
GET|HEAD api/travel/{travel}/tour/{tour} ................ tour.show › TravelTourController@show
PUT|PATCH api/travel/{travel}/tour/{tour} ............ tour.update › TravelTourController@update
DELETE api/travel/{travel}/tour/{tour} .......... tour.destroy › TravelTourController@destroy