PHPackages                             agunbuhori/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. [Framework](/categories/framework)
4. /
5. agunbuhori/action

ActiveLibrary[Framework](/categories/framework)

agunbuhori/action
=================

Laravel action package

v1.0(8mo ago)02MITPHP

Since Sep 12Pushed 8mo agoCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

⚡ Laravel Action
================

[](#-laravel-action)

A lightweight, extensible base class for building **Action classes** in Laravel.
This package helps you keep your code clean, testable, and reusable by encapsulating business logic into **Action objects** with built-in validation, request handling, array-like access, and artisan generator support.

---

🚀 Features
----------

[](#-features)

- ✅ Clean separation of business logic into Actions
- ✅ Built-in validation via Laravel `Validator`
- ✅ Automatic request binding
- ✅ Array-like data access (`ArrayAccess`)
- ✅ Combine with reusable traits like `HasResponder` [Laravel Responder](https://github.com/agunbuhori/laravel-responder)
- ✅ **Artisan command to generate new Actions quickly**
- ✅ Works smoothly with Laravel’s ecosystem

---

📦 Installation
--------------

[](#-installation)

```
composer require agunbuhori/action
```

---

🔧 Usage
-------

[](#-usage)

### 1. Generate an Action via Artisan

[](#1-generate-an-action-via-artisan)

You can scaffold a new Action using the included command:

```
php artisan make:action Auth/LoginAction
```

This will create a file at:

```
app/Actions/Auth/LoginAction.php

```

with a ready-to-use `Action` class template.

---

### 2. Example: LoginAction

[](#2-example-loginaction)

Here’s how a real-world Action might look:

```
