PHPackages                             klisica/api-formula - 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. [API Development](/categories/api)
4. /
5. klisica/api-formula

ActiveLibrary[API Development](/categories/api)

klisica/api-formula
===================

Laravel API architecture builder based on artisan commands.

v1.0.2(4y ago)1280MITPHP

Since Jan 3Pushed 4y ago1 watchersCompare

[ Source](https://github.com/KLisica/API-Formula)[ Packagist](https://packagist.org/packages/klisica/api-formula)[ RSS](/packages/klisica-api-formula/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (3)Versions (7)Used By (0)

🧑‍🔬 API-Formula
===============

[](#‍-api-formula)

### Laravel API architecture builder based on artisan commands.

[](#laravel-api-architecture-builder-based-on-artisan-commands)

This package provides a nice and fluent way to generate combined **controllers**, **models**, **migrations**, **requests**, **resources**, **repositories** and **services**, thus keeping the code well structured and organized.

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

[](#installation)

Install the package with composer, execute the setup command and register the `RepositoryServiceProvider.php` file in `config > app.php` under the `providers` array.

```
composer require klisica/api-formula
```

```
php artisan api-formula:setup
```

```
'providers' => [
    ...
    App\Providers\RepositoryServiceProvider::class,
    ...
 ],
```

Next, in `routes > api.php` add `// @API_FORMULA_AUTOIMPORT` comment in order to enable auto importing of resource routes. For example, I like to bind the importing in middleware group:

```
...
Route::midleware('auth:sanctum')->group(function () {
    Route::resource('job_posts', 'JobPostController')->parameters(['' => 'job_post']);
    ...
    // @API_FORMULA_AUTOIMPORT
});
```

To publish the config file run:

```
php artisan vendor:publish --provider="KLisica\ApiFormula\Providers\ApiFormulaServiceProvider"
```

Usage
-----

[](#usage)

⭐ To start the API builder run the following command:

```
php artisan api-make:formula
```

To manually create specific file you can use one of these commands:

```
php artisan api-make:model ModelName
php artisan api-make:migration create_example_table
php artisan api-make:repository RepositoryName --model=ModelName
php artisan api-make:service ServiceName
php artisan api-make:request RequestName
php artisan api-make:controller ControllerName --model=ModelName
```

Other external packages used with this package:

- [Laravel Eloquent UUID](https://github.com/goldspecdigital/laravel-eloquent-uuid)
- [Laracasts Generators](https://packagist.org/packages/laracasts/generators)

Filtering and sorting on models
-------------------------------

[](#filtering-and-sorting-on-models)

Each model is using a custom **Filterable** trait, which is handling simple query-based filtering and sorting functions on models.

- Filters are accepted in format `column[operator]=value`.
- To filter by **relations** the format is `relationName|column[operator]=value` (note the `|` separator in between).
- Free-text filter is by default `_text` query parameter.

**JSON example:**

```
{
    page: 1,
    per_page: 10,
    sort_by: ['created_at', 'desc'],
    'name[equal]': 'Name example',
    'relation|name[equal]': 'Relation name example',
    '_text': 'Search for something'
74

}
```

**Raw URL-Query example:**

```
http://api-formula.test/api/job_posts?per_page=10&page=1&sort_by[0]=created_at&sort_by[1]=desc&name[equal]=Name example&relation|name[equal]=Relation name example
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Every ~5 days

Total

6

Last Release

1569d ago

Major Versions

v0.3-alpha → v1.0.02022-01-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/900b06ba651eca5142c879e075335312a25826a24821d90b3a1de816f9382ea9?d=identicon)[KLisica](/maintainers/KLisica)

---

Top Contributors

[![klisica](https://avatars.githubusercontent.com/u/43316726?v=4)](https://github.com/klisica "klisica (29 commits)")

---

Tags

api-architecturelaravelrest-api

### Embed Badge

![Health badge](/badges/klisica-api-formula/health.svg)

```
[![Health](https://phpackages.com/badges/klisica-api-formula/health.svg)](https://phpackages.com/packages/klisica-api-formula)
```

###  Alternatives

[mollie/laravel-mollie

Mollie API client wrapper for Laravel &amp; Mollie Connect provider for Laravel Socialite

3624.1M28](/packages/mollie-laravel-mollie)[mll-lab/laravel-graphiql

Easily integrate GraphiQL into your Laravel project

683.2M9](/packages/mll-lab-laravel-graphiql)[spatie/laravel-route-discovery

Auto register routes using PHP attributes

23645.0k2](/packages/spatie-laravel-route-discovery)[esign/laravel-conversions-api

A laravel wrapper package around the Facebook Conversions API

69145.4k](/packages/esign-laravel-conversions-api)[didww/didww-api-3-php-sdk

PHP SDK for DIDWW API 3

1218.2k](/packages/didww-didww-api-3-php-sdk)[surface/laravel-webfinger

A Laravel package to create an ActivityPub webfinger.

113.8k](/packages/surface-laravel-webfinger)

PHPackages © 2026

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