PHPackages                             alibori/laravel-api-starter-kit - 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. alibori/laravel-api-starter-kit

ActiveProject[Framework](/categories/framework)

alibori/laravel-api-starter-kit
===============================

An API Laravel Starter Kit.

v0.0.1(today)00MITPHPPHP ^8.5

Since Jun 18Pushed todayCompare

[ Source](https://github.com/alibori/laravel-api-starter-kit)[ Packagist](https://packagist.org/packages/alibori/laravel-api-starter-kit)[ RSS](/packages/alibori-laravel-api-starter-kit/feed)WikiDiscussions main Synced today

READMEChangelog (1)Dependencies (19)Versions (2)Used By (0)

Laravel API Starter Kit
=======================

[](#laravel-api-starter-kit)

A minimal, opinionated Laravel 13 starter kit for building versioned JSON APIs. It ships with authentication, a strict code quality pipeline, and a Docker-based development environment so you can start writing endpoints immediately.

Requirements
------------

[](#requirements)

- PHP 8.5+
- Composer
- Docker (for Laravel Sail)
- Node.js and npm (used by the `setup` script for asset compilation)

Installation
------------

[](#installation)

### Using the Laravel installer (recommended)

[](#using-the-laravel-installer-recommended)

Requires the [Laravel installer](https://laravel.com/docs/installation#installing-php) (`composer global require laravel/installer`).

```
laravel new my-api --using=alibori/laravel-api-starter-kit
cd my-api
```

### Using Composer create-project

[](#using-composer-create-project)

```
composer create-project alibori/laravel-api-starter-kit my-api
cd my-api
```

Both methods above trigger `post-create-project-cmd` automatically: they generate the application key, create the SQLite database file, and run the initial migrations.

### Cloning the repository

[](#cloning-the-repository)

```
git clone https://github.com/alibori/laravel-api-starter-kit.git my-api
cd my-api
composer run setup
```

The `setup` script installs Composer and npm dependencies, generates the application key, runs migrations, and compiles front-end assets.

Running Locally
---------------

[](#running-locally)

Start the Docker services:

```
vendor/bin/sail up -d
```

Then start the development process (HTTP server, queue worker, log viewer, and Vite):

```
composer run dev
```

Stop Docker services when done:

```
vendor/bin/sail stop
```

### Ports

[](#ports)

ServiceDefault portHTTP80Vite5173Redis6379Override any port by setting `APP_PORT`, `VITE_PORT`, or `FORWARD_REDIS_PORT` in your `.env` file.

API Structure
-------------

[](#api-structure)

All API routes live under `routes/api/` and are version-prefixed. The router loads `routes/api/api.php`, which applies a `v1` prefix and delegates to `routes/api/v1/v1.php`. New API versions follow the same pattern by adding a new prefix group and a corresponding directory.

```
routes/
  api/
    api.php       # registers version prefix groups
    v1/
      v1.php      # v1 route definitions

```

### Current Endpoints

[](#current-endpoints)

MethodPathMiddlewareDescriptionGET/api/v1/userauth:sanctumReturns the authenticated userResponses follow the Laravel API Resources pattern.

Authentication
--------------

[](#authentication)

This kit uses [Laravel Sanctum](https://laravel.com/docs/sanctum) v4 for token-based authentication. Sanctum is configured out of the box including the `personal_access_tokens` table migration.

To obtain a token, issue one from Tinker or build an endpoint:

```
vendor/bin/sail artisan tinker --execute 'echo App\Models\User::first()->createToken("dev")->plainTextToken;'
```

Pass the token in the `Authorization` header:

```
Authorization: Bearer

```

Protected routes use the `auth:sanctum` middleware.

Development Commands
--------------------

[](#development-commands)

All commands are registered as Composer scripts and run via `composer run `.

CommandDescription`composer run setup`Full first-run setup: install deps, generate key, migrate, build assets`composer run dev`Start all services concurrently: PHP server, queue worker, log viewer (Pail), Vite`composer run analyse`Run PHPStan static analysis (level 7, 2 GB memory limit)`composer run format`Run Laravel Pint to fix code style`composer run refactor`Run Rector to apply automated refactors`composer run test`Clear config cache and run the full test suite`composer run test:parallel`Run tests in parallel across 5 processesAdditional utility scripts:

CommandDescription`composer run analyse:debug`PHPStan with verbose debug output`composer run test:format`Check code style without making changes (Pint dry-run)`composer run test:refactor`Preview Rector changes without applying themCode Quality
------------

[](#code-quality)

### Laravel Pint

[](#laravel-pint)

[Laravel Pint](https://laravel.com/docs/pint) enforces PSR-12 as the base preset with additional rules defined in `pint.json` (strict types, final classes, strict comparisons, arrow functions, and more).

```
composer run format          # fix all violations
composer run test:format     # report violations without fixing
```

### PHPStan / Larastan

[](#phpstan--larastan)

[Larastan](https://github.com/larastan/larastan) runs PHPStan at **level 7** against the `app/` directory. Configuration lives in `phpstan.neon`.

```
composer run analyse         # static analysis
composer run analyse:debug   # verbose output for debugging suppressions
```

### Rector

[](#rector)

[Rector](https://getrector.com/) is configured in `rector.php` to target PHP 8.5 syntax and Laravel 13 idioms. It runs against both `app/` and `tests/`.

```
composer run refactor        # apply refactors
composer run test:refactor   # preview changes without applying
```

Testing
-------

[](#testing)

The project uses [Pest](https://pestphp.com/) v4 with the Laravel plugin. Test suites are defined in `phpunit.xml`:

- `tests/Unit/` — isolated unit tests
- `tests/Feature/` — feature tests (database, HTTP)

Feature tests automatically use `RefreshDatabase` and fake Storage, HTTP, Queue, and Bus.

```
composer run test            # run all tests
composer run test:parallel   # run with 5 parallel workers
```

Filter to a specific test:

```
vendor/bin/sail artisan test --filter=SomeTestName
```

### Architecture Tests

[](#architecture-tests)

`tests/Feature/ArchTest.php` enforces project-wide rules on every CI run:

- No `dd`, `dump`, or `ray` calls left in code
- No direct `env()` calls outside of config files
- All classes under `App\` must declare strict types and use strict equality operators

AI Development
--------------

[](#ai-development)

This project includes [Laravel Boost](https://laravel.com/docs/ai) v2, which exposes an MCP (Model Context Protocol) server for AI coding agents such as Claude Code.

The MCP server is configured in `.mcp.json` and runs via Sail:

```
{
    "mcpServers": {
        "laravel-boost": {
            "command": "vendor/bin/sail",
            "args": ["artisan", "boost:mcp"]
        }
    }
}
```

Boost provides agents with tools for database inspection, documentation search, error log access, and URL resolution, all scoped to this application's installed package versions.

The `boost.json` file controls which agents, skills, and integrations are active. Current skills: `laravel-best-practices`, `pest-testing`, `spatie-laravel-php`, `spatie-javascript`, `spatie-security`, `spatie-version-control`.

License
-------

[](#license)

This project is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance100

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity40

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

Unknown

Total

1

Last Release

0d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/71702817?v=4)[Axel Libori Roch](/maintainers/alibori)[@alibori](https://github.com/alibori)

---

Top Contributors

[![alibori](https://avatars.githubusercontent.com/u/71702817?v=4)](https://github.com/alibori "alibori (3 commits)")

---

Tags

apiapi-versioninglaravelstarter-kitapiframeworklaravelbackend

###  Code Quality

TestsPest

Static AnalysisPHPStan, Rector

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/alibori-laravel-api-starter-kit/health.svg)

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

###  Alternatives

[laravel/laravel

The skeleton application for the Laravel framework.

84.5k62.4M1.0k](/packages/laravel-laravel)[unopim/unopim

UnoPim Laravel PIM

10.3k2.2k](/packages/unopim-unopim)[bagisto/bagisto

Bagisto Laravel E-Commerce

26.9k169.0k9](/packages/bagisto-bagisto)[krayin/laravel-crm

Krayin CRM

22.6k33.4k1](/packages/krayin-laravel-crm)[nasirkhan/laravel-starter

A CMS like modular Laravel starter project.

1.4k2.7k](/packages/nasirkhan-laravel-starter)[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.

3861.7k](/packages/codewithdennis-larament)

PHPackages © 2026

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