PHPackages                             didasto/apilot - 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. didasto/apilot

ActiveLibrary

didasto/apilot
==============

A Laravel package for rapid REST API development with model-based CRUD controllers.

v1.0.0(1mo ago)00MITPHPPHP ^8.2

Since Mar 29Pushed 1mo agoCompare

[ Source](https://github.com/didasto/apilot)[ Packagist](https://packagist.org/packages/didasto/apilot)[ RSS](/packages/didasto-apilot/feed)WikiDiscussions main Synced 1mo ago

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

Apilot — Rest API Package for Laravel
=====================================

[](#apilot--rest-api-package-for-laravel)

> Rapid REST API development with model-based and service-based CRUD controllers, automatic OpenAPI 3.0.3 documentation, and a flexible hook system.

Features
--------

[](#features)

- **Model-based CRUD** — Extend `ModelCrudController`, set `$model`, get five fully working endpoints with zero boilerplate.
- **Service-based CRUD** — Extend `ServiceCrudController` and implement `CrudServiceInterface` for non-Eloquent data sources (external APIs, custom repositories).
- **Lifecycle hooks** — Intercept and modify any CRUD operation via a comprehensive set of hooks (`beforeStore`, `afterStore`, `modifyIndexQuery`, `beforeDestroy`, …).
- **Automatic filtering, sorting, and pagination** — Declare allowed fields; the package handles the query logic.
- **OpenAPI 3.0.3 generation** — Live spec at `/api/doc`, exportable via Artisan command, with optional built-in validation.
- **Attribute-based documentation** — `#[OpenApiMeta]` and `#[OpenApiProperty]` for fine-grained spec control.

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

[](#requirements)

- PHP 8.2+
- Laravel 11.x or 12.x

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

[](#installation)

```
composer require didasto/apilot
```

If your application does not use package auto-discovery, register the provider manually in `config/app.php`:

```
'providers' => [
    Didasto\Apilot\ApilotServiceProvider::class,
],
```

Publish the configuration file:

```
php artisan vendor:publish --tag=apilot
```

Quick Start
-----------

[](#quick-start)

### Model-based Controller

[](#model-based-controller)

**1. The Eloquent model** (`app/Models/Post.php`):

```
