PHPackages                             mrprotocoll/api-boilerplate-laravel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. mrprotocoll/api-boilerplate-laravel

ActiveProject[Framework](/categories/framework)

mrprotocoll/api-boilerplate-laravel
===================================

This Laravel 11 API boilerplate provides a structured foundation for building robust backend applications with Laravel, integrating essential features and tools.

v0.1.0(1y ago)1172MITPHPPHP ^8.2

Since Jul 12Pushed 2w ago1 watchersCompare

[ Source](https://github.com/mrprotocoll/api-boilerplate-laravel)[ Packagist](https://packagist.org/packages/mrprotocoll/api-boilerplate-laravel)[ RSS](/packages/mrprotocoll-api-boilerplate-laravel/feed)WikiDiscussions main Synced yesterday

READMEChangelog (1)Dependencies (15)Versions (8)Used By (0)

**🕹️🕹️ Laravel API Boilerplate🕹️🕹️**
------------------------------------

[](#️️-laravel-api-boilerplate️️)

📗 Table of Contents
===================

[](#-table-of-contents)

- [📖 About the Project](#about-project)
    - [🛠 Built With](#built-with)
        - [Tech Stack](#tech-stack)
    - [🚀 Links](#api-docs)
    - [Features](#features)
- [💻 Getting Started](#getting-started)
    - [Setup](#setup)
    - [Prerequisites](#prerequisites)
    - [Usage](#usage)
- [🤝 Contributing](#contributing)

📖 API Boilerplate
===========================================================

[](#--api-boilerplate-)

A robust, modular Laravel 11 API boilerplate built using a Domain-Driven Design (DDD) approach. This boilerplate provides a scalable foundation for modern API development with essential features like role-based access, versioning, Google OAuth integration, and more..

### Features

[](#features)

- Domain-Driven Architecture: Organized modules and shared resources for scalability.
- Versioning: Supports multiple API versions with structured routing.
- Role-Based Access Control: Integrated roles and permissions with easy extensibility.
- Google OAuth: Simplified OAuth 2.0 authentication setup.
- Modular Components: Independent modules for Auth, User, and more.
- Enums and Helpers: Centralized, reusable enums and helper methods.
- Custom Middlewares: Pre-configured middlewares for JSON responses, caching, logging, and preventing duplicate requests.
- Optimized Exception Handling: Friendly and consistent error responses.
- Custom Base Model: A UUID-enabled base model for consistency across entities.
- Seeders and Factories: Simplified data seeding with predefined roles.
- Rate Limiting: API throttling to prevent abuse.
- Fully Documented: Swagger/OpenAPI support for API documentation.
- AI Agent Infrastructure: Provider adapters, DB-backed chat sessions, tool execution, usage limits, and streaming-ready API endpoints.

### Architecture Overview

[](#architecture-overview)

#### Domain-Driven Design (DDD)

[](#domain-driven-design-ddd)

The project structure is organized to separate concerns:

`src/modules`: Contains feature-specific modules, e.g., Auth and User. `src/shared`: Shared resources like helpers, enums, and base classes.

#### Versioning

[](#versioning)

Version-specific modules and routes are located in the `V1` directory for flexibility.

### Tech Stack

[](#tech-stack-)

- [PHP](https://www.php.net/)
- [Laravel](https://laravel.com/)

([back to top](#readme-top))

🚀 Links
--------------------------------------------

[](#-links-)

To access the documentation goto the below link

- Link to api routes

```
http://localhost:8000/v1

```

- Link to documentation

```
http://localhost:8000/v1/documentation

```

([back to top](#readme-top))

💻 Getting Started
-------------------------------------------------------------

[](#-getting-started-)

To get a local copy up and running, follow these steps.

### Prerequisites

[](#prerequisites)

In order to run this boilerplate, you need:

1. PHP ^8.2
    use the following link to setup `PHP` if you dont have it already installed on your computer

([install PHP](https://www.php.net/manual/en/install.php))

2. Composer
    use the following link to Download `Composer` if you dont have it already installed on your computer

([install Composer](https://getcomposer.org/download/))

Install
-------

[](#install)

clone the repository:

```
git clone git@github.com:mrprotocoll/api-boilerplate-laravel.git

```

Install dependencies:

```
composer install

```

Setup
-----

[](#setup)

Create your database.

create .env file, change using the .env.example file and update the Database, Google Oauth (optional), and Email credentials.

```
cp .env.example .env

```

Generate keys, Run the migration and seed roles:

```
php artisan key:generate
php artisan migrate --seed

```

### Usage

[](#usage)

The following command can be used to run the application.

```
  php artisan serve
```

### AI Agent Infrastructure

[](#ai-agent-infrastructure)

The boilerplate includes a ready-to-ship AI assistant module under `src/modules/V1/AI`.

Configure a provider in `.env`:

```
AI_PROVIDER=openai
OPENAI_API_KEY=
OPENAI_MODEL=gpt-4.1-mini
AI_MAX_TOOL_STEPS=3
AI_TOOL_RESULT_SYNTHESIS=true
```

Run migrations to create the AI tables:

```
php artisan migrate
```

Authenticated API endpoints:

```
POST   /v1/user/ai/sessions
GET    /v1/user/ai/sessions/latest
GET    /v1/user/ai/sessions
POST   /v1/user/ai/messages
POST   /v1/user/ai/messages/stream
PATCH  /v1/user/ai/messages/{messageId}/flag
GET    /v1/user/ai/sessions/{sessionToken}/messages

```

Send a message:

```
{
  "sessionToken": "optional-existing-session-token",
  "sourcePage": "/dashboard",
  "message": "What time is it and where can I edit my profile?"
}
```

The runtime supports native provider tools where available. It uses `AI_MAX_TOOL_STEPS` to prevent runaway loops and `AI_TOOL_RESULT_SYNTHESIS` to convert tool outputs into a final user-facing answer.

Default read-only tools:

- `current_time`
- `authenticated_user`
- `application_info`
- `navigate`

To add a tool, implement `Modules\V1\AI\Contracts\AIToolHandler`, return an `AIToolDefinition`, and register the handler in `AIToolRegistry`. Keep mutating tools disabled or confirmation-gated by setting `mutatesState` or `requiresConfirmation` on the definition and replacing `AIToolAuthorizer` with your application permission logic.

([back to top](#readme-top))

Contributing
------------

[](#contributing)

Feel free to fork the repository, make changes, and submit pull requests. Feedback is always welcome!

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance69

Regular maintenance activity

Popularity12

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~362 days

Total

2

Last Release

359d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/43586022?v=4)[Damilare Protocoll](/maintainers/mrprotocoll)[@mrprotocoll](https://github.com/mrprotocoll)

---

Top Contributors

[![mrprotocoll](https://avatars.githubusercontent.com/u/43586022?v=4)](https://github.com/mrprotocoll "mrprotocoll (52 commits)")

---

Tags

boilerplateboilerplate-laravellaravel-11laravel-11-boilerplatelaravel-boiframeworklaravelboilerplate

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mrprotocoll-api-boilerplate-laravel/health.svg)

```
[![Health](https://phpackages.com/badges/mrprotocoll-api-boilerplate-laravel/health.svg)](https://phpackages.com/packages/mrprotocoll-api-boilerplate-laravel)
```

###  Alternatives

[unopim/unopim

UnoPim Laravel PIM

10.5k2.4k](/packages/unopim-unopim)[bagisto/bagisto

Bagisto Laravel E-Commerce

27.6k172.1k9](/packages/bagisto-bagisto)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[krayin/laravel-crm

Krayin CRM

23.2k33.6k1](/packages/krayin-laravel-crm)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3891.8k](/packages/codewithdennis-larament)[ercogx/laravel-filament-starter-kit

This is a Filament v5 Starter Kit for Laravel 13, designed to accelerate the development of Filament-powered applications.

461.7k](/packages/ercogx-laravel-filament-starter-kit)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
