NewYour coding agent can read the release notes before it upgrades.Set up the MCP server β
Packagist, #961 most downloaded on Packagist
Laravel components that take care of one specific task
Latest stable
2.13.0
Last release 1 months ago
15 Oct 2026
Release timing varies
gaps range from 8 days to 7 months
Nearly every release is documented
notes for 57 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
8 years old
73 releases Β· first in 2019
Drag across the ruler to compare, or tap a release to open it.
You can now run actions as commands by simply providing the commandSignature static property.
You can now run actions as commands by simply providing the commandSignature static property.
class PublishANewArticle extends Action
{
protected static $commandSignature = 'make:article {title} {body}';
protected static $commandDescription = 'Publishes a new article';
// ...
}
You can now register your routes directly in the routes static method of your actions.
class GetArticlesFromAuthor extends Action
{
public static function routes(Router $router)
{
$router->get('author/{author}/articles', static::class);
}
public function handle(User $author)
{
return $author->articles;
}
}
Imagine the following GetItineraryInstructions action that returns an array of strings given an address and a transportation mode. Here is how you would need to instantiate this action:
$action = new GetItineraryInstructions([
'address' => $address,
'mode' => 'driving',
]);
However, in this particular case, this action will always take an address and a mode attribute so wouldn't it be better if we could just write this instead?
$action = new GetItineraryInstructions($address, 'driving');
Well, starting from v1.0, you can. All you need to do to make this work is to define your custom logic in the getAttributesFromConstructor method. See the documentation to learn more about this.
Note that, this will also work with the run and dispatch static methods.
// As an object.
GetItineraryInstructions::run($address, 'driving');
// As a job.
GetItineraryInstructions::dispatch($address, 'driving');
# In your composer.json
"lorisleiva/laravel-actions": "^1.0",
composer update lorisleiva/laravel-actions
The register method has been renamed initialized. It will be called every single time an action is instantiated no matter how it is running. (See The lifecycle of an action).
In order to register actions as commands and register routes directly within actions, Laravel Actions need to know where your Actions are kept. By default, it will look inside the app/Actions directory. This new discovery mechanism might interfere with your current architecture. If this is the case, you can tell Laravel Actions were to look for actions using Actions::paths([...]) in a service provider. Alternatively you can disable this altogether via the Actions::dontRegister() method. (See Registering actions).
<details><summary>Finally, A few internal method signatures have been adjusted.</summary> <p>
- public function updateAttributeWithResolvedInstance($key, $instance)
+ protected function updateAttributeWithResolvedInstance($key, $instance): void
- protected function findAttributeFromParameter($name, $extras = [])
+ protected function findAttributeFromParameter($name, $extras = []): array
- protected function resolveMethodDependencies($instance, $method, $extras = [])
+ protected function resolveMethodDependencies($instance, $method, $extras = []): array
- public function delegateTo($actionClass)
+ public function delegateTo(string $actionClass)
</p> </details>
Your coding agent can read these notes before it upgrades. Set up the MCP server β
β οΈ This is a potential breaking change if your application is overriding the run method. If that's the case make sure to override the handleRun methodβ¦
β¬οΈ Add support for Laravel 7 (#35) π No longer instantiate every listener to check if it's an action (#33) β¨ Add the following new static helpers to run actions (#36)
MyAction::make([/* ... */])
// Equivalent to:
new MyAction([/* ... */]);
MyAction::run([/* ... */])
// Equivalent to:
(new MyAction)->run([/* ... */]);
β οΈ This is a potential breaking change if your application is overriding the run method. If that's the case make sure to override the handleRun method instead.
// Previous signature to override.
public function run(array $attributes = [])
// New signature to override.
protected function handleRun(array $attributes = [])
β¨ Add support for dependency injection to the following methods: `rules()`, `messages()` and `attributes()`.
β¨ Add support for dependency injection to the following methods: rules(), messages() and attributes().
This means you can now resolve your Eloquent models or Service classes before even reaching the handle() method.
This could be helpful, for example, when excluding a model in a unique rule.
class UpdateTeamProfile extends Action
{
public function rules(Team $team)
{
return [
'name' => ['filled', 'max:255'],
'slug' => [
'filled',
'alpha_dash',
Rule::exists('teams')->ignore($team->id),
],
];
}
public function handle(Team $team)
{
$team->update($this->validated());
return $team;
}
}
π Edit the Bus Dispatcher so that it uses the action itself as a job handler instead of a proxy. This allows the use of properties like public $timeou
π Edit the Bus Dispatcher so that it uses the action itself as a job handler instead of a proxy. This allows the use of properties like public $timeout directly within the action. (see #28)
π Restart validation every time we re-run an action.
__isset magic method. (#27)Clear cached Event Facade instance
prepareForValidation method (9c99635af7cd8d20a8034bec49e50c107896c818)β¬οΈ Add support for Laravel 6.x
β¬οΈ Add support for Laravel 6.x
β οΈ Middleware registration (breaking changes) In preparation of Laravel 6, the middleware registration changes slightly to follow the same API as theβ¦
β οΈ Middleware registration (breaking changes) In preparation of Laravel 6, the middleware registration changes slightly to follow the same API as the upcoming Job middleware.
// Before.
public function register()
{
$this->middleware('auth');
}
// After.
public function middleware()
{
return ['auth'];
}
β¨ Actions are now invokable as objects
// When running an action as an object.
$action = new PublishANewArticle([
'title' => 'My blog post',
'body' => 'Lorem ipsum.',
]);
// You can now run it like this...
$action();
// Which is equivalent to...
$action->run();
Nothing published for this version
π Fix issue #7 by decorating the existing event dispatcher instead of overriding it with a new instance.
π Fix issue #7 by decorating the existing event dispatcher instead of overriding it with a new instance.
π Fixes issue #4 by moving rebindings from the register method to the boot method. See this comment for more information on why this was needed.
π Fixes issue #4 by moving rebindings from the register method to the boot method. See this comment for more information on why this was needed.
Nothing published for this version
Package ready but documentation in progress.
Package ready but documentation in progress.
One column per quarter.