Skip to content

Latest commit

 

History

History
39 lines (28 loc) · 1.87 KB

README.md

File metadata and controls

39 lines (28 loc) · 1.87 KB

Nest Logo

Laravel API

Description

This is a REST API developed with Laravel 10 and PHP 8. It is a simple API that allows you to register and login a user. The authentication is done with JWT over a Bearer token. All the authentication and authorization is done with the extension Laravel Passport. The endpoints are protected with the middleware auth:api and the routes are protected with the middleware auth and verified. The API is documented with Swagger and the documentation can be found at the endpoint /api/documentation.

Installation

$ git clone
$ cd laravel-api
$ composer install
$ cp .env.example .env # Edit the .env file with your database credentials
$ php artisan migrate
$ php artisan db:seed
$ php artisan passport:install
$ php artisan l5-swagger:generate
$ php artisan serve

Development process

The development process was done using a simplified version of Gitflow Workflow. The main branch is main. The features are developed in branches named feat/<feature-name> and the hotfixes are developed in branches named hotfix/<hotfix-name>. The features and hotfixes are merged into main when a release is made, since this is just a demo project. In a real project, the features and hotfixes would be merged into develop and the main branch would be used only for releases.

Before starting a new feature

$ git checkout main
$ git pull
$ git checkout -b feat/<feature-name>

References

https://www.itsolutionstuff.com/post/laravel-8-rest-api-with-passport-authentication-tutorialexample.html