Download the PHP package ahmedbenkrarayc/larasecurestart without Composer
On this page you can find all versions of the php package ahmedbenkrarayc/larasecurestart. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ahmedbenkrarayc/larasecurestart
More information about ahmedbenkrarayc/larasecurestart
Files in ahmedbenkrarayc/larasecurestart
Package larasecurestart
Short Description A secure Laravel JWT authentication starter kit with HttpOnly cookies, built by Ahmed Benkrara.
License CC-BY-4.0
Informations about the package larasecurestart
LaraSecureStart
LaraSecureStart is a secure, scalable Laravel 12+ starter kit developed by Ahmed Benkrara that brings modern JWT-based authentication with HTTP-only cookies and built-in role-based access control. It's built with clarity, security, and real-world API architecture in mind.
⚙️ Features
- ✅ JWT authentication via secure HTTP-only cookies
- 🔄 Automatic token refresh endpoint
- 🔐 Pre-configured middlewares:
jwt.api
→ Auth guard via access token (cookie-based)jwt.refreshtoken
→ Refresh token validationrole
→ Role-based route restrictions
- 👥 Multi-role support (
admin
,storeowner
,customer
, etc.) - 📩 Forgot and reset password endpoints
- 🌍 CORS fully configured for SPA/frontend interaction
- 📦 Easy installation via Composer or Laravel Installer
- 🚀 Production-ready out of the box (automated
.env
,APP_KEY
, andJWT_SECRET
generation)
🚀 Installation
Option 1: Laravel Installer (Recommended)
Option 2: Composer
🛠 After installation:
✅
.env
,APP_KEY
, andJWT_SECRET
are all generated automatically.
🔐 Authentication Flow
Endpoint | Method | Description | Middleware |
---|---|---|---|
/api/register |
POST | Register a new user | – |
/api/login |
POST | Authenticate and issue tokens | – |
/api/logout |
POST | Clear tokens from HTTP-only cookie | jwt.api |
/api/refresh |
POST | Get a new access token | jwt.refreshtoken |
/api/forgot-password |
POST | Send reset link via email | – |
/api/reset-password |
POST | Reset password with email token | – |
/api/user |
GET | Get authenticated user | jwt.api |
🔐 Role-Based Access Middleware
Use the role
middleware to restrict access to routes by user role:
Middleware logic is located in:
🧠 Example Route Group Usage
Your api.php
might look like this:
🌐 CORS Configuration
Preconfigured and located at:
Supports:
- Multiple domains
withCredentials: true
for HTTP-only cookie handling- Safe for SPAs like Vue, React, Nuxt, etc.
🧑💻 About the Creator
Ahmed Benkrara
📧 [email protected]
🔗 GitHub: ahmedbenkrarayc
📝 License
This project is licensed under the Creative Commons Attribution 4.0 International License (CC BY 4.0).
All versions of larasecurestart with dependencies
laravel/framework Version ^12.0
php-open-source-saver/jwt-auth Version ^2.8
laravel/tinker Version ^2.10.1