Closed nickfls closed 2 years ago
Thats because i am stupid and cannot read. Sorry, we are all good:
For a hy onlooker:
use Lorisleiva\Actions\Concerns\ValidateActions;
will create this conflict
namespace App\Actions\TestAction;
use Lorisleiva\Actions\Concerns\AsAction;
use Lorisleiva\Actions\Concerns\WithAttributes;
class TestAction
{
use AsAction;
use WithAttributes;
public function rules(): array
{
return [
'id' => 'required',
];
}
public function handle(array $attributes = []): array
{
$this->fill($attributes);
return $this->validateAttributes();
}
}
will work just fine.
Sorry again!
Steps to repeat:
and then in Action class:
when executed as
App\Actions\TestAction::run(['id'=>1])
will throwCall to protected method App\Actions\TestAction::prepareForValidation() from scope Illuminate\Container\BoundMethod in /home/vagrant/action-test/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php on line 36