PHPackages                             rabibgalib/api-action - 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. rabibgalib/api-action

ActiveLibrary[API Development](/categories/api)

rabibgalib/api-action
=====================

This packages will help to create APIs with Controller, Request, Traits, Model, Migration, Action Classes, Helper Class.

v1.0.1(2y ago)10281MITPHPPHP ^7.4|^8.0

Since Sep 10Pushed 2y ago1 watchersCompare

[ Source](https://github.com/RabibHossain/api-action)[ Packagist](https://packagist.org/packages/rabibgalib/api-action)[ RSS](/packages/rabibgalib-api-action/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)DependenciesVersions (9)Used By (0)

[![Total Downloads](https://camo.githubusercontent.com/45dcd47ff41c6d23fd9856a2755c26fe101672687a767aba2504ededd1e45370/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f726162696267616c69622f6170692d616374696f6e)](https://packagist.org/packages/rabibgalib/api-action)[![Latest Stable Version](https://camo.githubusercontent.com/7cdc42b3b42e927b4120692bab2063fba90af47eb6ca3a8525a5b9b13b0a40e4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f726162696267616c69622f6170692d616374696f6e)](https://packagist.org/packages/rabibgalib/api-action)[![License](https://camo.githubusercontent.com/a62e2cad9dc9e8dc71fcb45d939f7a8a73b8215c7b74ac3ac195c2c0c31e6c62/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f726162696267616c69622f6170692d616374696f6e)](https://packagist.org/packages/rabibgalib/api-action)

### Api Action Structure

[](#api-action-structure)

```
        app
        └── ApiActionPackages
        │   └── {{ActionName}}
        │   │   └── Actions
        │   │   │   ├── Create{{ActionName}}
        │   │   │   ├── Delete{{ActionName}}
        │   │   │   ├── Find{{ActionName}}
        │   │   │   ├── List{{ActionName}}
        │   │   │   └── Update{{ActionName}}
        │   │   └── Helpers
        │   │       └── {{ActionName}}Helper
        │   └── BaseHelper
        │   │   └── BaseHelper
        │   └── Traits
        │       └── ApiResponse
        └── Http
        │   └── Controllers
        │   │   └── {{ActionName}}Controller
        │   └── Requests
        │       └── {{ActionName}}Request
        └── Models
        │   └── {{ActionName}}Model
        └── database
            └── migrations
                └── create_{{ActionName}}_table

```

api-action
==========

[](#api-action)

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

[](#installation)

```
composer require rabibgalib/api-action
```

Configuration
-------------

[](#configuration)

Add the provider to your `config/app.php` into `provider` section if using lower version of laravel,

```
\Rabibgalib\ApiAction\ApiActionServiceProvider::class,
```

If you face `419 (page expired)` error or `CORS` or `XSRF` issue for a new project or have not fixed the issue, then update `App/Http/Middleware/VerifyCsrfToken.php` as -

```
  protected $except = [
      "*"
  ];
```

Run Command
-----------

[](#run-command)

After the installation &amp; configuration run the command as -

```
  php artisan make:api-action ActionName
```

Example
=======

[](#example)

If you want to create a **Post action api**. Please write command as -

```
  php artisan make:api-action Api/Post
```

This command will create

- an API PostController
- Action directory
    - Action classes
    - Helper classes
    - Trait
- Form Request
- Model
- Migration
    to perform a feature wise service for your application.

[![api-action-post.PNG](https://raw.githubusercontent.com/RabibHossain/images/main/api-action-post.PNG?token=GHSAT0AAAAAACC6LYYKRCSLCTZ5FAMW6J2WZH56IUA)](https://raw.githubusercontent.com/RabibHossain/images/main/api-action-post.PNG?token=GHSAT0AAAAAACC6LYYKRCSLCTZ5FAMW6J2WZH56IUA)

Now put below codes inside `Post` Model as -

```
protected $fillable = [
      'author',
      'title',
      'description'
  ];
```

Now put below codes inside `posts` Migration as -

```
$table->string('author')->nullable();
$table->string('title')->nullable();
$table->string('description')->nullable();
```

After migration command, set up the routes/web.php as -

```
use App\Http\Controllers\Api\PostController;
Route::get('posts', [PostController::class, 'index']);
Route::post('post', [PostController::class, 'create']);
Route::get('post/{id}', [PostController::class, 'find']);
Route::put('post/{id}', [PostController::class, 'update']);
Route::delete('post/{id}', [PostController::class, 'delete']);
```

Now, you can test the APIs in Postman or Insomnia easily.

[![post-api-action.gif](https://raw.githubusercontent.com/RabibHossain/images/main/post-api-action.gif?token=GHSAT0AAAAAACC6LYYLGBMI72SUADS3R2DMZH552MQ)](https://raw.githubusercontent.com/RabibHossain/images/main/post-api-action.gif?token=GHSAT0AAAAAACC6LYYLGBMI72SUADS3R2DMZH552MQ)

### Have fun. Happy Coding.

[](#have-fun-happy-coding)

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity53

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 ~1 days

Total

8

Last Release

973d ago

Major Versions

v0.0.6 → v1.0.02023-09-18

### Community

Maintainers

![](https://www.gravatar.com/avatar/7424c1d3e653c80bb8634972b71ee6703d6af428115a3f0da9a6ded10beea431?d=identicon)[RabibHossain](/maintainers/RabibHossain)

---

Top Contributors

[![RabibHossain](https://avatars.githubusercontent.com/u/12703179?v=4)](https://github.com/RabibHossain "RabibHossain (14 commits)")

### Embed Badge

![Health badge](/badges/rabibgalib-api-action/health.svg)

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

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M480](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M272](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M187](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M454](/packages/google-gax)

PHPackages © 2026

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