⚡️ Laravel components that take care of one specific task
MIT License
Bot releases are visible (Hide)
Published by lorisleiva over 3 years ago
Make Laravel Actions ready for Octane by always accessing the container and the request on demand rather than storing them as class properties (requires manual testing to ensure it works properly).
Published by lorisleiva over 3 years ago
ShouldBeUnique
can be tested using the assertPushed
helper method (#120).Actions::registerCommands($paths)
method for auto-registration of commands (#112).Published by lorisleiva over 3 years ago
Support controllers with explicit methods (See #123 and #110).
Published by lorisleiva over 3 years ago
Allow UniqueJobDecorator
to be prepended in the asJob
arguments. (See #95)
Published by lorisleiva over 3 years ago
Published by lorisleiva over 3 years ago
Add support for optional unified attributes (See #100)
class MyAction
{
use AsAction;
use WithAttributes;
public function handle(array $attributes = [])
{
$this->fill($attributes);
$this->validateAttributes();
// ...
}
}
Published by lorisleiva over 3 years ago
php artisan make:action
is back (#86)
Published by lorisleiva almost 4 years ago
Fix a bug that did not clear fake instances when running multiple tests within the same application instance.
Instead of storing the fake instance as a static property on the action class, it is now stored as a prefixed container instance and so they are automatically cleared between each tests (See 5136c3e8828effe08de56d317aca8dce8ea9bb2f).
Published by lorisleiva almost 4 years ago
Ensure the ActionRequest
and therefore the validator refreshes between requests even on validation failure. (2a0a8c59f43b4afb77c10d29cb3da4025e29651f)
Published by lorisleiva almost 4 years ago
Support injecting (optionally) a Batch
or JobDecorator
as the first argument of the asJob
method.
// Without injecting.
public function asJob($foo, $bar)
{
// ...
}
// Injecting the batch.
public function asJob(?Batch $batch, $foo, $bar)
{
// ...
}
// Injecting the decorator.
public function asJob(JobDecorator $job, $foo, $bar)
{
// ...
}
Published by lorisleiva almost 4 years ago
Support batchable jobs.
Bus::batch([
FirstAction::makeJob(1),
SecondAction::makeJob(2),
ThirdAction::makeJob(3),
])->then(function () {
// All jobs completed successfully...
})->dispatch();
Published by lorisleiva almost 4 years ago
Support registering actions as commands in the scheduler.
$scheduler->command(MyAction::class)->daily();
Add setters on the JobDecorators
to set more properties using the configureJob
method.
public function configureJob(JobDecorator $job): void
{
$job->setTries(10)
->setMaxExceptions(3)
->setTimeout(60 * 30);
}
Published by lorisleiva almost 4 years ago
Support more configuration properties and methods from AsJob
.
$jobTries
$jobMaxExceptions
$jobBackoff
$jobTimeout
$jobRetryUntil
getJobBackoff
getJobRetryUntil
Published by lorisleiva almost 4 years ago
⚡️ Laravel Actions has been re-written from scratch and provides a much simpler, less intrusive API allowing you to run any PHP class as anything you want.
Published by lorisleiva almost 4 years ago
Use stubs to generate Actions through the make command (#78)
Published by lorisleiva almost 4 years ago
⬆️ Support PHP 8
Published by lorisleiva almost 4 years ago
⚙️ Ensure Models and Collections are serialized correctly within attributes when running an action as a Job. (See #68)
Published by lorisleiva almost 4 years ago
🚑 Fix getAttributesFromConstructor method when running as a controller (cfcfc3d38d18399edbaaf7a873f759cd318d8f74)
Published by lorisleiva almost 4 years ago
📝 Ignore console output when the return value is null
Published by lorisleiva about 4 years ago
🔭 Add optional HasTelescopeTags
trait (#53)