v0.2.0
// 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();