Setup
1) Install
This package is installed from a private Git repository.
Configure Composer Repository (VCS)
In your host application's composer.json, add a VCS repository entry:
{
"repositories": [
{
"type": "vcs",
"url": "https://github.com/<org>/<repo>.git"
}
]
}Authenticate (Private Repo)
Use one of these approaches:
- SSH: use an SSH URL in
repositories.urland ensure your deploy key / SSH agent is configured - HTTPS token: configure a token using Composer auth (recommended) instead of putting tokens in
composer.json
Require the Package
Then require the package in your host Laravel app:
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, and optional modules:
php artisan sp-laravel-api:validateTry auto-fixing common issues:
php artisan sp-laravel-api:validate --fix