moemadeldin / laravel-api-starter-kit
The skeleton application for the Laravel framework.
Package info
github.com/moemadeldin/laravel-api-starter-kit
Type:project
pkg:composer/moemadeldin/laravel-api-starter-kit
Requires
- php: ^8.5.0
- laravel/framework: ^13.1.1
- laravel/mcp: ^0.6.3
- laravel/prompts: ^0.3.15
- laravel/sanctum: ^4.0
- laravel/tinker: ^3.0
- nunomaduro/essentials: ^1.2
Requires (Dev)
- barryvdh/laravel-ide-helper: ^3.7
- driftingly/rector-laravel: ^2.2.0
- fakerphp/faker: ^1.24.1
- larastan/larastan: ^3.9.3
- laravel/boost: ^2.3
- laravel/pail: ^1.2.6
- laravel/pint: ^1.29.0
- laravel/tinker: ^v3.0.0
- mockery/mockery: ^1.6.12
- nunomaduro/collision: ^8.9.1
- pestphp/pest: ^5.0
- pestphp/pest-plugin-browser: ^5.0
- pestphp/pest-plugin-laravel: ^5.0
- pestphp/pest-plugin-type-coverage: ^5.0
- rector/rector: ^2.3.9
- roave/security-advisories: dev-latest
This package is auto-updated.
Last update: 2026-04-28 07:55:42 UTC
README
A production-ready Laravel API starter kit with Sanctum authentication, Pest testing, PHPStan static analysis, and Laravel Boost AI-assisted development.
Tech Stack
| Package | Version |
|---|---|
| PHP | 8.5+ |
| Laravel | 13.x |
| Laravel Sanctum | 4.x |
| Pest | 5.x |
| PHPStan / Larastan | 3.x |
| Laravel Boost | 2.x |
Requirements
- PHP >= 8.5
- Composer
- MySQL 8.0+ / PostgreSQL 15+
- Node.js / Bun (for frontend assets)
Installation
Via Composer Create Project
composer create-project moemadeldin/laravel-api-starter-kit my-api
Post Installation
cd my-api # Copy environment file and generate key cp .env.example .env php artisan key:generate # Configure your database in .env, then run migrations php artisan migrate # Install dependencies composer install bun install bun run build
Environment Variables
Configure these in your .env file:
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=root
DB_PASSWORD=
API Endpoints
All endpoints are versioned under /api/v1.
| Method | Endpoint | Auth | Description |
|---|---|---|---|
| POST | /api/v1/register |
Guest | Register a new user |
| POST | /api/v1/login |
Guest | Login and get token |
| DELETE | /api/v1/logout |
Bearer | Logout (revoke token) |
Authentication
Use Laravel Sanctum tokens. Include the token in the Authorization header:
Authorization: Bearer {your-token}
Development Commands
# Start full dev environment (server, queue, logs, vite) composer run dev # Format code with Pint vendor/bin/pint --dirty # Lint (Rector + Pint) composer lint # Static analysis composer test:types # Run tests composer test # Run specific test php artisan test --compact --filter=TestName
Testing
This project uses Pest for testing with 100% type coverage enforced.
# Run all tests with type coverage and static analysis composer test # Run only feature tests php artisan test tests/Feature # Run only unit tests php artisan test tests/Unit
Project Structure
app/
├── Actions/Auth/ # Business logic actions
├── Controllers/API/V1/ # Versioned API controllers
├── Enums/ # Database-level enums
├── Exceptions/ # Custom exceptions
├── Http/
│ ├── Middleware/ # HTTP middleware
│ ├── Requests/ # Form request validators
│ └── Resources/ # API resources
├── Models/ # Eloquent models
├── Services/ # Reusable services
└── Utilities/ # Constants, traits, helpers
AI-Assisted Development
This project includes Laravel Boost for AI-powered development with Opencode.
Setup
- Install Laravel Boost:
composer require laravel/boost --dev php artisan boost:install
- Add MCP server to
~/.config/opencode/opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"laravel-boost": {
"type": "local",
"command": ["php", "artisan", "boost:mcp"],
"enabled": true
}
}
}
- Run
/mcpsin Opencode to verify the connection.
Available Tools
database-schema- Inspect table structuresdatabase-query- Run read-only SQL queriessearch-docs- Version-aware Laravel documentationtinker- Execute PHP code in the app contextread-log-entries- Read application logsbrowser-logs- Read browser console logs
Code Quality
| Check | Command |
|---|---|
| Static Analysis | composer test:types |
| Lint Check | composer test:lint |
| Type Coverage | composer test:type-coverage |
| All Checks | composer test |
License
MIT