mauveine / tour-travels-api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Laravel Logo

Build Status Total Downloads Latest Stable Version License

Setup

Requirements

  • php: ^8.1
  • composer: ^2.0

Composer

Install the project install all packages:

composer install

Project start

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

Project tests

To run all the tests run the following command:

php artisan test

Coverage

To check the project's coverage run the following command (xDebug required):

XDEBUG_MODE=coverage php artisan test --coverage

Linter and static analysis

Laravel Pint

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

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

Business Logic

The business logic and requirements can be found in this document.

Main endpoints

Main endpoints can be found here.

All Endpoints

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

About


Languages

Language:PHP 83.6%Language:Blade 16.3%Language:JavaScript 0.2%