An open API service indexing awesome lists of open source software.

https://github.com/ayoub-aberbach/lara_rest_auth

Laravel API Authentication Boilerplate
https://github.com/ayoub-aberbach/lara_rest_auth

laravel mysql php sanctum-authentication

Last synced: 3 months ago
JSON representation

Laravel API Authentication Boilerplate

Awesome Lists containing this project

README

        

# Laravel API Authentication Boilerplate

A REST API authentication system built with Laravel, providing user authentication, profile management, and secure access to protected routes.

## Features
- **User Registration**: Allows new users to create accounts.
- **Login**: Authenticates users and provides access tokens.
- **Logout**: Ends user sessions securely.
- **Update User Data**: Enables users to modify their account details.
- **Profile Picture Management**: Allows users to upload and change profile pictures.
- **Protected Routes**: Uses Laravel Sanctum middleware to secure API endpoints.
- **Security Measures**: Revokes all tokens when the user changes their password or email.
- **Local Storage**: Stores profile pictures locally for easy access.

## Installation

### 1. Install Dependencies
```sh
composer install
```

### 2. Set Up the Environment File
```sh
cp .env.example .env
```

### 3. Generate an Application Key
```sh
php artisan key:generate
```

### 4. Configure the Database
Edit the `.env` file with your database credentials:
```env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database_name
DB_USERNAME=your_database_user
DB_PASSWORD=your_database_password
```

## Project Structure
```
project-folder/
│── app/
│── bootstrap/
│── config/
│── database/
│── routes/
│── storage/
│── .env.example
│── composer.json
│── artisan
```