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

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

ninthspace/action
=================

1.1.2(5y ago)064MITPHPCI failing

Since Jun 10Pushed 5y ago1 watchersCompare

[ Source](https://github.com/ninthspace/action)[ Packagist](https://packagist.org/packages/ninthspace/action)[ Docs](https://github.com/ninthspace/action)[ RSS](/packages/ninthspace-action/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (4)Dependencies (5)Versions (5)Used By (0)

Action
======

[](#action)

[![Tests](https://github.com/ninthspace/action/workflows/Tests/badge.svg?branch=master)](https://github.com/ninthspace/action/workflows/Tests/badge.svg?branch=master)[![Coverage](https://camo.githubusercontent.com/d26f1ba280f2dbcdd356dbaaf3c3fa9946c6c01cad902ec2240b335054a11f7b/68747470733a2f2f636f6465636f762e696f2f67682f6e696e746873706163652f616374696f6e2f6272616e63682f6d61737465722f67726170682f62616467652e737667)](https://codecov.io/gh/ninthspace/action)[![Latest Version on Packagist](https://camo.githubusercontent.com/9faefc3d11f84939773b9620d734f1316db54496af699379f7edb3e7e73414c4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e696e746873706163652f616374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ninthspace/action)[![Total Downloads](https://camo.githubusercontent.com/bb77031916475640116748f9d920fa70bce651e1ef25fc3adc48b8c362d0738e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e696e746873706163652f616374696f6e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/ninthspace/action)

A simple Action class for PHP.

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

[](#installation)

You can install the package via composer:

```
composer require ninthspace/action
```

Usage
-----

[](#usage)

An Action class is just a way of encapsulating repeatable or reusable code, which is usually defined or extracted from other classes to improve readability or testability.

To use this package simply extend it:

```
class MyAction extends \Ninthspace\Action
{
}
```

Doing so will give you two additional methods:

- `handle` which is a method you should write to perform the action, and,
- `authorise` which is an optional method you can write that returns if the action is authorised (by the user, for example)

**Note:** You can use `authorize` if you prefer the alternative spelling.

If you create `authorise` and it fails, a `\Ninthspace\Action\Exceptions\AuthorisationException` will be raised.

**Note:** If you want a different authorisation exception to be raised you can override it in your Action, thus:

```
class MyAction extends \Ninthspace\Action
{
    public $authorisationException = \Illuminate\Auth\Access\AuthorizationException::class
}
```

To invoke an action call its `run` method:

```
class MyAction extends \Ninthspace\Action
{
    public function handle()
    {
        return 'done';
    }
}

(new MyAction())->run() // returns "done";
```

You can pass arguments into the `run` method and then update the `handle` function definition accordingly.

Changelog
---------

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [Chris Aves](https://github.com/ninthspace)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

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

Total

4

Last Release

2051d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/248954?v=4)[Chris Aves](/maintainers/ninthspace)[@ninthspace](https://github.com/ninthspace)

---

Top Contributors

[![ninthspace](https://avatars.githubusercontent.com/u/248954?v=4)](https://github.com/ninthspace "ninthspace (10 commits)")

---

Tags

actionninthspace

###  Code Quality

TestsPest

### Embed Badge

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

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

###  Alternatives

[tormjens/eventy

The WordPress filter/action system in Laravel

439951.1k24](/packages/tormjens-eventy)[marcelog/pami

Asterisk Manager Interface (AMI) client for PHP, event driven, object oriented

418773.0k1](/packages/marcelog-pami)[markwalet/nova-modal-response

A Laravel Nova asset for Modal responses on an action.

17878.9k](/packages/markwalet-nova-modal-response)[chan-sccp/pami

Asterisk Manager Interface (AMI) client for PHP, event driven, object oriented (Fork)

2954.7k](/packages/chan-sccp-pami)[prevailexcel/laravel-action-service-trait

A simple Laravel package to create actions, traits and services using artisan commands

143.5k](/packages/prevailexcel-laravel-action-service-trait)

PHPackages © 2026

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