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
- Host: GitHub
- URL: https://github.com/ayoub-aberbach/lara_rest_auth
- Owner: ayoub-aberbach
- Created: 2024-08-20T17:29:35.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2025-02-12T01:21:44.000Z (4 months ago)
- Last Synced: 2025-02-12T02:30:35.154Z (4 months ago)
- Topics: laravel, mysql, php, sanctum-authentication
- Language: PHP
- Homepage:
- Size: 68.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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
```