PHPackages                             opscale-co/actions - 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. opscale-co/actions

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

opscale-co/actions
==================

Loris Leiva - Laravel Actions extension with Nova additions

1.0.2(3mo ago)0447↑125%8MITPHPPHP &gt;=8.2CI passing

Since Dec 18Pushed 3mo agoCompare

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

READMEChangelog (3)Dependencies (6)Versions (4)Used By (8)

Support us
----------

[](#support-us)

At Opscale, we’re passionate about contributing to the open-source community by providing solutions that help businesses scale efficiently. If you’ve found our tools helpful, here are a few ways you can show your support:

⭐ **Star this repository** to help others discover our work and be part of our growing community. Every star makes a difference!

💬 **Share your experience** by leaving a review on [Trustpilot](https://www.trustpilot.com/review/opscale.co) or sharing your thoughts on social media. Your feedback helps us improve and grow!

📧 **Send us feedback** on what we can improve at . We value your input to make our tools even better for everyone.

🙏 **Get involved** by actively contributing to our open-source repositories. Your participation benefits the entire community and helps push the boundaries of what’s possible.

💼 **Hire us** if you need custom dashboards, admin panels, internal tools or MVPs tailored to your business. With our expertise, we can help you systematize operations or enhance your existing product. Contact us at  to discuss your project needs.

Thanks for helping Opscale continue to scale! 🚀

Description
-----------

[](#description)

> **One logic unit to rule them all.**

Encapsulate your business logic in atomic, self-contained classes and reuse them across your entire application stack. Write once, use everywhere.

This package extends [Laravel Actions](https://laravelactions.com) with support for:

- **Laravel Nova Actions** - Use actions directly as Nova actions
- **Laravel MCP Tools** - Use actions as Model Context Protocol tools for AI

The same logic can serve multiple audiences:

- **For end users** → Nova Actions in your admin panel
- **For administrators** → Artisan commands in the terminal
- **For external systems** → API endpoints via controllers
- **For AI agents** → MCP tools for intelligent automation

[![Actions demo](https://raw.githubusercontent.com/opscale-co/actions/refs/heads/main/screenshots/actions.gif)](https://raw.githubusercontent.com/opscale-co/actions/refs/heads/main/screenshots/actions.gif)

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

[](#installation)

[![Latest Version on Packagist](https://camo.githubusercontent.com/6843d6c342cd3db4e57faf0003be96042299b2c3bd6e130f06027f4329e93816/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6f707363616c652d636f2f616374696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/opscale-co/actions)

You can install the package via composer:

```
composer require opscale-co/actions
```

The package is automatically registered via Laravel's package discovery.

Usage
-----

[](#usage)

### Real-World Example: ResetPassword

[](#real-world-example-resetpassword)

Here's a complete example showing how a single `ResetPassword` action can serve your entire application:

```
use Opscale\Actions\Action;

class ResetPassword extends Action
{
    public function identifier(): string
    {
        return 'reset-password';
    }

    public function name(): string
    {
        return 'Reset Password';
    }

    public function description(): string
    {
        return 'Resets a user\'s password';
    }

    public function parameters(): array
    {
        return [
            [
                'name' => 'email',
                'description' => 'The email address of the user',
                'type' => 'string',
                'rules' => ['required', 'email', 'exists:users,email'],
            ],
            [
                'name' => 'password',
                'description' => 'The new password',
                'type' => 'string',
                'rules' => ['required', 'string', 'min:8'],
            ],
            [
                'name' => 'password_confirmation',
                'description' => 'Confirm the new password',
                'type' => 'string',
                'rules' => ['required', 'string', 'same:password'],
            ],
        ];
    }

    public function handle(array $attributes = []): array
    {
        $this->fill($attributes);
        $validated = $this->validateAttributes();

        $user = User::where('email', $validated['email'])->firstOrFail();
        $user->update(['password' => Hash::make($validated['password'])]);

        return [
            'success' => true,
            'message' => 'Password reset successfully'
        ];
    }
}
```

### One Action, Multiple Contexts

[](#one-action-multiple-contexts)

Now this single class can be used everywhere:

```
// For end users → Nova Action in admin panel
// Register in your Nova Resource:
public function actions(NovaRequest $request)
{
    return [
        ResetPassword::make()
    ];
}

// For administrators → Artisan command
// php artisan reset-password --email=user@example.com --password=newpass123
$this->commands([
    ResetPassword::class,
]);

// For external systems → API endpoint
Route::post('/api/reset-password', ResetPassword::class);

// For AI agents → MCP tool
// Register in your MCP Server:
class PlatformServer extends Server
{
    protected array $tools = [
        ResetPassword::class
    ];
}
```

### Opinionated Design

[](#opinionated-design)

This package is an opinionated implementation that enforces the use of `WithAttributes` from [Laravel Actions](https://laravelactions.com). All input data flows through `fill()` and `validateAttributes()`, ensuring consistent parameters validation and attribute handling across all contexts.

The package provides a default behavior for all four audiences (Nova Actions, Artisan Commands, Controllers, and MCP Tools), so your actions work out of the box without additional configuration, but it can be overriden using the speficic methods for each output.

Testing
-------

[](#testing)

```
npm run test
```

Changelog
---------

[](#changelog)

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

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

[](#contributing)

Please see [CONTRIBUTING](https://github.com/opscale-co/.github/blob/main/CONTRIBUTING.md) for details.

Security
--------

[](#security)

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

Credits
-------

[](#credits)

Built by [Opscale](https://github.com/opscale-co) on top of:

- [Laravel Actions](https://laravelactions.com) by Loris Leiva
- [Laravel Nova](https://nova.laravel.com) by Laravel
- [Laravel MCP](https://github.com/laravel/mcp) by Laravel

License
-------

[](#license)

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

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance82

Actively maintained with recent releases

Popularity17

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% 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 ~31 days

Total

3

Last Release

90d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3722594?v=4)[opscale](/maintainers/opscale)[@opscale](https://github.com/opscale)

---

Top Contributors

[![opscale-development](https://avatars.githubusercontent.com/u/181295122?v=4)](https://github.com/opscale-development "opscale-development (6 commits)")[![semantic-release-bot](https://avatars.githubusercontent.com/u/32174276?v=4)](https://github.com/semantic-release-bot "semantic-release-bot (3 commits)")

---

Tags

laravelpackagetoolnovaopscale

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/opscale-co-actions/health.svg)

```
[![Health](https://phpackages.com/badges/opscale-co-actions/health.svg)](https://phpackages.com/packages/opscale-co-actions)
```

###  Alternatives

[pdmfc/nova-info-card

A Laravel Nova info card.

14103.0k2](/packages/pdmfc-nova-info-card)[cendekia/nova-setting-tool

An app setting manager tool for laravel nova

4010.5k](/packages/cendekia-nova-setting-tool)[demency/nova-gridder

A Laravel Nova Package for resource details grids.

1615.1k](/packages/demency-nova-gridder)

PHPackages © 2026

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