PHPackages                             lumosolutions/actionable - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. lumosolutions/actionable

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lumosolutions/actionable
========================

Provides a clean, elegant way to create dispatchable and runnable actions in Laravel with built-in array conversion capabilities

v1.1.1(11mo ago)166592MITPHPPHP &gt;=8.3CI passing

Since May 25Pushed 11mo ago1 watchersCompare

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

READMEChangelog (6)Dependencies (4)Versions (7)Used By (0)

⚡ Actionable
============

[](#-actionable)

[![CI Pipeline](https://github.com/LumoSolutions/actionable/actions/workflows/build.yml/badge.svg)](https://github.com/LumoSolutions/actionable/actions/workflows/build.yml)[![codecov](https://camo.githubusercontent.com/cc59ac68c18c9a528a7fb54a46a7abb493aa912101730986048f62bb577e3204/68747470733a2f2f636f6465636f762e696f2f67682f4c756d6f536f6c7574696f6e732f616374696f6e61626c652f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/LumoSolutions/actionable)[![Latest Stable Version](https://camo.githubusercontent.com/837770db4a660dff443725f553c5cc62f62e0d737b2ad0d05fe56d21b38fca77/68747470733a2f2f706f7365722e707567782e6f72672f6c756d6f736f6c7574696f6e732f616374696f6e61626c652f762f737461626c65)](https://packagist.org/packages/lumosolutions/actionable)[![Total Downloads](https://camo.githubusercontent.com/b3a819872282f9a1619ff9e973f395ae263b208395ea073790c34263c7221509/68747470733a2f2f706f7365722e707567782e6f72672f6c756d6f736f6c7574696f6e732f616374696f6e61626c652f646f776e6c6f616473)](https://packagist.org/packages/lumosolutions/actionable)[![License](https://camo.githubusercontent.com/5f737b767546fd1978be049ebb1238c6da797cc8d4a5140e1a159d3ea493a0bf/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4c756d6f536f6c7574696f6e732f616374696f6e61626c65)](LICENSE)

**[Installation](#-installation)** • **[Quick Start](#-quick-start)** • **[Features](#-key-features)** • **[Documentation](#-documentation)** • **[Examples](#-real-world-examples)**

[![hero](https://private-user-images.githubusercontent.com/860443/447370411-9d7e5e3b-cb82-4fff-a242-847d16051d18.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ0MzU2MTEsIm5iZiI6MTc3NDQzNTMxMSwicGF0aCI6Ii84NjA0NDMvNDQ3MzcwNDExLTlkN2U1ZTNiLWNiODItNGZmZi1hMjQyLTg0N2QxNjA1MWQxOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzI1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMyNVQxMDQxNTFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iYzQ3NGI4YzFiOWRmMjY5YTgxMTM4ZGQ4ZDkyNjZmNDBiMmY4YjlkODYxNzRmZWJiZGNkYjk2N2VhMTVkZTViJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.ChZda5hEQAgQcjbSD9srjUfHn0R_xedMkUKyiwLNHWo)](https://private-user-images.githubusercontent.com/860443/447370411-9d7e5e3b-cb82-4fff-a242-847d16051d18.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3NzQ0MzU2MTEsIm5iZiI6MTc3NDQzNTMxMSwicGF0aCI6Ii84NjA0NDMvNDQ3MzcwNDExLTlkN2U1ZTNiLWNiODItNGZmZi1hMjQyLTg0N2QxNjA1MWQxOC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwMzI1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDMyNVQxMDQxNTFaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1iYzQ3NGI4YzFiOWRmMjY5YTgxMTM4ZGQ4ZDkyNjZmNDBiMmY4YjlkODYxNzRmZWJiZGNkYjk2N2VhMTVkZTViJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.ChZda5hEQAgQcjbSD9srjUfHn0R_xedMkUKyiwLNHWo)

> **Transform your Laravel code into clean, testable, and reusable actions.** Say goodbye to bloated controllers and hello to elegantly organized business logic!

💡 Why Actionable?
-----------------

[](#-why-actionable)

Ever found yourself writing the same business logic patterns over and over? Controllers getting too fat? Service classes becoming a mess? **Actionable is here to save the day!**

```
// ❌ The old way - Fat controllers, messy code
class UserController extends Controller
{
    public function register(Request $request)
    {
        // Validation logic...
        // User creation logic...
        // Email sending logic...
        // Queue processing...
        // 200 lines later...
    }
}

// ✅ The Actionable way - Clean, focused, reusable
RegisterUser::run($userData);
```

🎯 Key Features
--------------

[](#-key-features)

### 🏃‍♂️ **Runnable Actions**

[](#‍️-runnable-actions)

Execute business logic with a single, expressive call. No more hunting through service classes!

### 📬 **Dispatchable Actions**

[](#-dispatchable-actions)

Seamlessly queue your actions for background processing. It's as easy as changing `run()` to `dispatch()`!

### 💡 **Smart Code Completion**

[](#-smart-code-completion)

Full IntelliSense support with auto-completion for runnable and dispatchable actions across all major IDEs.

### 🔄 **Smart Array Conversion**

[](#-smart-array-conversion)

Convert between arrays and objects effortlessly with our powerful attribute system. Perfect for APIs!

### 🛠️ **Artisan Generators**

[](#️-artisan-generators)

Scaffold Actions and DTOs in seconds with our intuitive Artisan commands.

### 🎨 **Flexible Attributes**

[](#-flexible-attributes)

Fine-tune serialization behavior with elegant attributes like `#[FieldName]`, `#[DateFormat]`, and more!

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

[](#-installation)

```
composer require lumosolutions/actionable
```

That's it! No configuration needed. Start writing better code immediately.

🚀 Quick Start
-------------

[](#-quick-start)

### Your First Action in 30 Seconds

[](#your-first-action-in-30-seconds)

**1️⃣ Generate an action:**

```
php artisan make:action SendWelcomeEmail
```

**2️⃣ Define your logic:**

```
class SendWelcomeEmail
{
    use IsRunnable;

    public function handle(string $email, string $name): void
    {
        Mail::to($email)->send(new WelcomeEmail($name));
    }
}
```

**3️⃣ Use it anywhere:**

```
SendWelcomeEmail::run('user@example.com', 'John Doe');
```

**That's it!** Clean, testable, reusable. 🎉

📚 Documentation
---------------

[](#-documentation)

### ⚡ Actions

[](#-actions)

Actions are the heart of your application's business logic. They're single-purpose classes that do one thing and do it well.

#### Basic Actions

[](#basic-actions)

```
class CalculateOrderTotal
{
    use IsRunnable;

    public function handle(Order $order): float
    {
        return $order->items->sum(fn($item) => $item->price * $item->quantity);
    }
}

// Usage
$total = CalculateOrderTotal::run($order);
```

#### Queueable Actions

[](#queueable-actions)

Need background processing? Just add a trait!

```
class ProcessVideoUpload
{
    use IsRunnable, IsDispatchable;

    public function handle(Video $video): void
    {
        // Heavy processing logic here
    }
}

// Run synchronously
ProcessVideoUpload::run($video);

// Or dispatch to queue
ProcessVideoUpload::dispatch($video);

// Use a specific queue
ProcessVideoUpload::dispatchOn('video-processing', $video);
```

### 🗄️ Data Transfer Objects (DTOs)

[](#️-data-transfer-objects-dtos)

DTOs with superpowers! Convert between arrays and objects seamlessly.

```
class ProductData
{
    use ArrayConvertible;

    public function __construct(
        public string $name,
        public float $price,
        public int $stock
    ) {}
}

// From request data
$product = ProductData::fromArray($request->validated());

// To API response
return response()->json($product->toArray());
```

### 🏷️ Powerful Attributes

[](#️-powerful-attributes)

#### `#[FieldName]` - API-Friendly Naming

[](#fieldname---api-friendly-naming)

```
class UserResponse
{
    use ArrayConvertible;

    public function __construct(
        #[FieldName('user_id')]
        public int $userId,

        #[FieldName('full_name')]
        public string $fullName
    ) {}
}
```

#### `#[DateFormat]` - Date Formatting Made Easy

[](#dateformat---date-formatting-made-easy)

```
class EventData
{
    use ArrayConvertible;

    public function __construct(
        #[DateFormat('Y-m-d')]
        public DateTime $date,

        #[DateFormat('H:i')]
        public DateTime $startTime
    ) {}
}
```

#### `#[ArrayOf]` - Handle Nested Objects

[](#arrayof---handle-nested-objects)

```
class ShoppingCart
{
    use ArrayConvertible;

    public function __construct(
        #[ArrayOf(CartItem::class)]
        public array $items
    ) {}
}
```

#### `#[Ignore]` - Keep Secrets Secret

[](#ignore---keep-secrets-secret)

```
class UserAccount
{
    use ArrayConvertible;

    public function __construct(
        public string $email,

        #[Ignore]
        public string $password,

        #[Ignore]
        public string $apiSecret
    ) {}
}
```

### 🛠️ Artisan Commands

[](#️-artisan-commands)

Generate boilerplate with style:

```
# Basic action
php artisan make:action ProcessOrder

# Queueable action
php artisan make:action SendNewsletter --dispatchable

# Invokable action
php artisan make:action CalculateShipping --invokable

# DTO with array conversion
php artisan make:dto OrderData

# Enable Smart Code Completion
php artisan ide-helper:actions
```

🌟 Real-World Examples
---------------------

[](#-real-world-examples)

### E-commerce Order Processing

[](#e-commerce-order-processing)

```
// The DTO
class OrderData
{
    use ArrayConvertible;

    public function __construct(
        #[FieldName('customer_email')]
        public string $customerEmail,

        #[ArrayOf(OrderItemData::class)]
        public array $items,

        #[FieldName('discount_code')]
        public ?string $discountCode = null
    ) {}
}

// The Action
class ProcessOrder
{
    use IsRunnable, IsDispatchable;

    public function handle(OrderData $orderData): Order
    {
        $order = DB::transaction(function () use ($orderData) {
            $order = Order::create([...]);

            // Process items
            foreach ($orderData->items as $item) {
                $order->items()->create([...]);
            }

            // Apply discount
            if ($orderData->discountCode) {
                ApplyDiscount::run($order, $orderData->discountCode);
            }

            return $order;
        });

        // Queue follow-up actions
        SendOrderConfirmation::dispatch($order);
        UpdateInventory::dispatch($order);

        return $order;
    }
}

// Usage - It's this simple!
$orderData = OrderData::fromArray($request->validated());
$order = ProcessOrder::run($orderData);
```

### User Registration Flow

[](#user-registration-flow)

```
class RegisterUser
{
    use IsRunnable;

    public function handle(RegistrationData $data): User
    {
        $user = CreateUser::run($data);

        SendWelcomeEmail::dispatch($user);
        NotifyAdmins::dispatch($user);
        TrackRegistration::dispatch($user, $data->referralSource);

        return $user;
    }
}
```

🤲 Contributing
--------------

[](#-contributing)

We love contributions! Whether it's a bug fix, new feature, or improvement to our docs - we appreciate it all. Please feel free to submit a pull request or open an issue.

📄 License
---------

[](#-license)

Actionable is open-sourced software licensed under the [MIT license](LICENSE).

💬 Support &amp; Community
-------------------------

[](#-support--community)

- 🐛 **Found a bug?** [Open an issue](https://github.com/LumoSolutions/actionable/issues)
- 💡 **Have an idea?** [Start a discussion](https://github.com/LumoSolutions/actionable/discussions)
- 🔒 **Security concern?** Email me at

---

**Built with ❤️ by [Lumo Solutions](https://lumosolutions.org)**

*Actionable: Making Laravel development more enjoyable, one action at a time.*

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance51

Moderate activity, may be stable

Popularity26

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity56

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

Total

6

Last Release

345d ago

PHP version history (2 changes)v1.0.0PHP &gt;=8.2

v1.1.1PHP &gt;=8.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/e9e2a2c374e65d21a6a2f1c8e4c788288d6697fabeafbe3799c35093705fbced?d=identicon)[LumoSolutions](/maintainers/LumoSolutions)

---

Top Contributors

[![RichardAnderson](https://avatars.githubusercontent.com/u/860443?v=4)](https://github.com/RichardAnderson "RichardAnderson (16 commits)")

---

Tags

actionableactionsdto-patternlaravellaravel-packagelumosolutionslaravelarray conversionactionsrunnabledispatchable

###  Code Quality

TestsPest

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/lumosolutions-actionable/health.svg)

```
[![Health](https://phpackages.com/badges/lumosolutions-actionable/health.svg)](https://phpackages.com/packages/lumosolutions-actionable)
```

###  Alternatives

[tormjens/eventy

The WordPress filter/action system in Laravel

438912.9k16](/packages/tormjens-eventy)[defstudio/actions

Helpers methods for Laravel Actions

119.8k](/packages/defstudio-actions)

PHPackages © 2026

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