laravel-workflow
laravel-workflow copied to clipboard
Argument Error - Argument 1 passed to Symfony\\Component\\Workflow\\Marking::__construct() must be of the type array, string given
I am getting the following error
Argument 1 passed to Symfony\Component\Workflow\Marking::__construct() must be of the type array, string given, called in vendor/symfony/workflow/MarkingStore/MultipleStateMarkingStore.php on line 47
Hi Can you please provide sample code?
Seem the error is thrown when i use any WorkflowTrai method workflow_can(),workflow_apply()
$model = Post::find(1);
$model->workflow_apply($request->get("workflow"));
$model->save();
Where request workflow is "to_review"
Can you please add:
- Your PHP version
- Your Laravel Version
I'm not able to reproduce this, and it will help a lot for debugging.
Can you please add:
- Your PHP version
- Your Laravel Version
I'm not able to reproduce this, and it will help a lot for debugging.
Thank Brexis for reply
i am using PHP 7.2 and Lumen (6.2.0) (Laravel Components ^6.0)
hey @brexis, facing same issue, please update ASAP PHP - 7.3 laravel 5.8
@Kreateyou and @brexis
in workflow.php (config)
'marking_store' => [
'type' => 'single_state', // 'multiple_state',
'arguments' => ['status'],
],
fixed my issue, but you need to fix this issue :)
Hello, I had the same error message with the multiple_state type (not with single_state) To solve it with the multiple_state, you have to specify the field of your argument in your model like this :
protected $casts = [
'status' => 'array'
];
Fabien