Setup
1) Install
This package is published on Packagist (sopheak/sp-laravel-api). Install it directly via Composer in your Laravel application:
composer require sopheak/sp-laravel-api2) Generate Config Scaffolding
Run the setup command to publish package config and create the record/audit/attachments/webhooks configs and folders:
php artisan sp-laravel-api:setupOverwrite existing generated files:
php artisan sp-laravel-api:setup --forceThis creates (or updates) common paths like:
config/sp-record.phpconfig/sp-audit.phpconfig/sp-attachments.phpconfig/sp-webhooks.phpconfig/records/tables/*config/records/global-functions/*
(These publish under sp--prefixed filenames; the config namespace each one feeds — record, audit, attachments, webhooks — is unchanged. See Upgrade 0.4.80 → 0.4.82 for details if you have older, unprefixed copies of these files already published.)
It also attempts to inject default rate limiters into app/Providers/AppServiceProvider.php:
api-readsapi-writesapi-functions
3) Run Migrations
Run database migrations in your host app:
php artisan migrate4) Validate Setup
Run the validator to check config files, directories, migrations, routes, function definitions, and optional modules. For every table and global function it warns when the class or method does not exist, an httpMethod is invalid, or a querySchema / payloadSchema / responseSchema is malformed:
php artisan sp-laravel-api:validateTry auto-fixing common issues:
php artisan sp-laravel-api:validate --fix5) Laravel Boost & AI Agent Setup (Optional)
sp-laravel-api ships first-class AI guidelines (resources/boost/guidelines/core.blade.php), an agent skill (resources/boost/skills/sp-laravel-api-development/SKILL.md), and a local stdio MCP server (sp-laravel-api:mcp).
Option A: With Laravel Boost (laravel/boost)
- Install Laravel Boost and run its installer (it auto-discovers
sopheak/sp-laravel-api's guidelines andsp-laravel-api-developmentskill):
composer require laravel/boost --dev
php artisan boost:install- Merge the
sp-laravel-apiMCP server into.mcp.json(preservinglaravel-boostand any other MCP servers) and validate the setup:
php artisan sp-laravel-api:boostNote:
boost:installregenerates.mcp.jsonfrom scratch. Re-runphp artisan sp-laravel-api:boostwheneverboost:installregenerates.mcp.json, or runphp artisan boost:updatewhen updating guidelines and skills.
Option B: Standalone Agent Setup (Without Laravel Boost)
Install the sp-laravel-api-development skill (.agents/skills/), rules (.agents/rules/sp-laravel-api.md), and .mcp.json entry directly:
php artisan sp-laravel-api:agent
# Overwrite existing skill/rules after upgrading sp-laravel-api:
php artisan sp-laravel-api:agent --forceSee MCP Support — Laravel Boost & Agent Setup for full options (--skill, --rules, --mcp).