PHPackages                             attia-ahmed/extendable-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. attia-ahmed/extendable-action

ActiveLibrary[Framework](/categories/framework)

attia-ahmed/extendable-action
=============================

An Abstract classes to make extendable actions for the Laravel framework.

V1.0.2(4y ago)371Apache-2.0PHPPHP ^7.3|^8.0

Since Jan 11Pushed 4y ago1 watchersCompare

[ Source](https://github.com/Attia-Ahmed/ExtendableAction)[ Packagist](https://packagist.org/packages/attia-ahmed/extendable-action)[ RSS](/packages/attia-ahmed-extendable-action/feed)WikiDiscussions main Synced today

READMEChangelog (3)Dependencies (3)Versions (6)Used By (0)

ExtendableAction
================

[](#extendableaction)

Laravel packages that allows you to make your laravel project extendable and easy to include new features without touching old code throgh Extendable Actions .

Why ExtendableAction?
---------------------

[](#why-extendableaction)

Having a large codebase and dynamic features leads to a missy codebase with huge maintainability headache! This package implements the main concept of WordPress pluggable features by using of Filters and Actions ( See [WordPress Hooks](https://developer.wordpress.org/plugins/hooks/) ) that allow you to expand your codebase in a pluggable way.

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

[](#installation)

1. Install via composer

```
$ composer require attia-ahmed/extendable-action
```

or add it by hand to your `composer.json` file.

2. Publish the config file with:

```
php artisan vendor:publish --tag="extendable-action-provider"
```

3. Append to your `providers` in `app.php`config file :

```
App\Providers\ExtendableActionAppServiceProvider::class,
```

Usage
-----

[](#usage)

1. make your extendable action:

Which is the main functionality that needs to be extended. You can make your extendable action by extending `ExtendableAction` class and define the `run` method that take any number of parameters (will be modified by filters) and return result (will be modified by actions) then it will be called as Invokable Class Example:

```
class ExampleExtendableAction extends ExtendableAction
{
    public function run($name)
    {
        return "Hello " . $name;
    }
}
```

2. make your filters:

Which are classes that modifies the `ExtendableAction` input parameters or do some logic/check before running the main functionality. You can make your Filter by extending `Filter` class and override the `apply` method that takes `run` method parameters of `ExtendableAction` as an array and returns array of parameters to be modified with another filters or to be passed to main `ExtendableAction`Example:

```
class ExampleFilter extends Filter
{
    public function apply(array $args): array
    {
        $args["name"] = "Mr. " . $args["name"];
        return $args;
    }
}
```

3. make your actions:

Which are classes that modifies the `ExtendableAction` result or do some logic/check after running the main functionality. You can make your Action by extending `Action` class and override the `apply` method that takes the result of`run` method of `ExtendableAction` and returns new result to be modified with another actions or to be final return result of `ExtendableAction` functionality. Example:

```
class ExampleAction extends Action
{
    public function apply($result)
    {
        return "{$result}";
    }
}
```

4. Link your Filters and Actions to your Extendable action :

You can link your Filters and Action to your Extendable Action by adding new element in `ExtendableActionAppServiceProvider`protected attribute `$extendable_actions`or by your custom implementation by overriding `getFilters` and `getActions` of `ExtendableAction` class Example :

```
   protected array $extendable_actions = [

        ExampleExtendableAction::class => [
            "filters" => [
                ExampleFilter::class
            ],
            "actions" => [
                ExampleAction::class
            ]
        ],
    ];
```

5. Call your Extendable action :

`ExtendableAction` is an Invokable Class and can be called by as one of following examples:

```
//RECOMMENDED so it automatically be executed it while injecting its dependencies
$result = app(ExampleExtendableAction::class)(...$args);
```

or

```
$result = (new ExampleExtendableAction())(...$args);
```

Compatibility with other packages
=================================

[](#compatibility-with-other-packages)

[spatie/laravel-queueable-action](https://github.com/spatie/laravel-queueable-action/):
---------------------------------------------------------------------------------------

[](#spatielaravel-queueable-action)

you can use Extendable Action with Queueable Actions as following:

1. Extend your Queueable Action from `ExtendableAction`
2. Add your code logic in custom defined `run(...$args)` method **(Do Not Override \_\_invoke() method)**
3. call your Queuable action as normal and Extend it with any Filters or Actions 🎉

**note: You should return result to be returned to your Actions attached to Extendable Action**

**All your Filters and Action will run in queue**

### Examle:

[](#examle)

Queuable Extendable Action:

```
class ExampleExtendedQueueableAction extends ExtendableAction
{
    use QueueableAction;

    public function run(Example1 $example1, Example2 $example2)
    {
        //custom logic happen in queue
        return $result;
    }
}
```

### usage:

[](#usage-1)

```
app(ExampleExtendedQueueableAction::class)()->onQueue()->execute($example1, $example2);
```

Usage Notes
===========

[](#usage-notes)

*⚠️This package is a proof of concept and IS NOT READY for production.⚠️*
-------------------------------------------------------------------------

[](#️this-package-is-a-proof-of-concept-and-is-not-ready-for-production️)

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 97.9% 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 ~0 days

Total

4

Last Release

1578d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9e4a366778896b035cbb398a680022042881efada47288613388068119931039?d=identicon)[Attia](/maintainers/Attia)

---

Top Contributors

[![Attia-Ahmed](https://avatars.githubusercontent.com/u/17402336?v=4)](https://github.com/Attia-Ahmed "Attia-Ahmed (46 commits)")[![ObaydaAlesawi](https://avatars.githubusercontent.com/u/32073999?v=4)](https://github.com/ObaydaAlesawi "ObaydaAlesawi (1 commits)")

### Embed Badge

![Health badge](/badges/attia-ahmed-extendable-action/health.svg)

```
[![Health](https://phpackages.com/badges/attia-ahmed-extendable-action/health.svg)](https://phpackages.com/packages/attia-ahmed-extendable-action)
```

###  Alternatives

[code16/sharp

Laravel Content Management Framework

78959.5k4](/packages/code16-sharp)[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3691.5k](/packages/codewithdennis-larament)[ecotone/laravel

Laravel integration for Ecotone

21307.6k3](/packages/ecotone-laravel)

PHPackages © 2026

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