Building a REST API With Sanctum Authentication
Sancutm provides a featherweight authentication system for SPAs (single page applications), mobile applications, and simple, token based APIs. To learn more about sanctum, click this link: (https://laravel.com/docs/9.x/sanctum)
The following tools were used in the building of the project:
- PHP, version: 8.0.2
- Composer, version: 2.3.4
- Laravel, version: 9.2
- Sanctum, version: 2.14.1
-
In this first part you will clone the repository:
git clone https://github.com/leticiadia/api-rest-sanctum.git
-
Next you will enter the directory:
cd api-rest-sanctum
-
Copy the .env.example file and rename it to .env
-
Add all the values for the environment variables.
-
The next step is to install the dependencies:
composer install
-
Run the application in development mode
php artisan serve
-
The server will start on port:8000 - go to http://localhost:8000
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Developed with 💜 by Leticia Dias