---
url: https://record-api-docs.vercel.app/guide/getting-started.md
---

# Getting Started

## Quick Start

```bash
# 1. Install the package
composer require mylekha/record-api

# 2. Generate/publish configs (record/audit/record-api)
php artisan record-api:setup

# 3. Publish package migrations + run migrations
php artisan vendor:publish --tag=record-api-migrations
php artisan migrate

# 4. Define rate limiters in your AppServiceProvider (see below)

# 5. Configure at least 1 table in config/record.php (see below) or scaffold a table config via the record command

# 6. Test a public read endpoint
curl -X GET http://your-app.test/api/v1/users
```

### AI Assistants

The package ships AI guidelines and skills in `resources/boost`. With [Laravel Boost](https://github.com/laravel/boost) installed, run `php artisan boost:install` (or `boost:update`) and select `mylekha/record-api`: your coding assistant then learns how to configure tables, hooks and functions, and how to call the API.

Agents calling a running app can read `/{api_prefix}/docs/llms.txt` and the OpenAPI spec at `/{api_prefix}/docs/openapi.json`. The documentation itself is available to agents at https://record-api-docs.vercel.app/llms.txt.

## Features

* **🔄 Dynamic API Controller**: Full CRUD operations for any database table with advanced filtering
* **🚀 Upsert Support**: Atomic update-or-create operations with configurable matching logic
* **📊 Standardized API Responses**: Consistent JSON response format across your application
* **🔍 QueryHelpers Trait**: Powerful trait for advanced query filtering and manipulation
* **📝 Audit Logging**: Comprehensive audit trail for all data changes with queue-based processing
* **🔐 Permission System**: Optional Spatie Laravel Permission integration for role-based access control
* **🔑 Authentication Driver Agnostic**: Works with any Laravel auth guard (JWT, Sanctum, Passport, etc.)
* **📚 OpenAPI Spec Generation**: CLI command to generate API documentation
* **🎯 Request ID Middleware**: Automatic request tracking for debugging and monitoring
* **⚡ Performance Optimized**: Query caching and lazy loading
* **🧹 Audit Log Cleanup**: CLI command for cleaning old audit logs based on retention policy
* **🏢 Multi-Tenant Ready**: Built-in support for tenant isolation
* **🔧 Configuration Publishing**: Easy setup with sensible defaults

## Requirements

* **PHP**: 8.2 or higher
* **Laravel**: 12.x
* **Database**: MySQL 8.0+, PostgreSQL 13+, or SQLite 3.8+
* **Extensions**: BCMath, Ctype, JSON, Mbstring, OpenSSL, PDO, Tokenizer, XML

## Dependencies and Optional Integrations

Core dependency installed with the package:

* **Carbon** (^2.0 or ^3.0) - Date manipulation library

Optional integrations you can install in your application:

* **Spatie Laravel Permission** (^6.21) - Role and permission management
* **PHP Open Source Saver JWT Auth** (^2.8.2) - JSON Web Token authentication (install/configure in your app)
