random_int() for workflow transition IDs).readonly properties in workflow models).from/to places).bindWhen() for context-aware workflow resolution).whereIn optimizations) may reduce overhead for workflow state queries.guard constraints can now use Laravel 13’s rule objects).WorkflowServiceProvider::boot()).spatie/laravel-config-array can now be used for runtime overrides without caching issues.// config/workflows.php
return [
'order_workflow' => [
'supports' => [\App\Models\Order::class],
'places' => ['draft', 'submitted', 'approved', 'cancelled'],
'transitions' => [
'submit' => [
'from' => 'draft',
'to' => 'submitted',
'guard' => \App\Guards\OrderSubmissionGuard::class,
],
],
],
];
WorkflowTransitionEvent dispatched to queue:work).| Risk Area | Mitigation Strategy |
|---|---|
| Laravel 13 Breaking Changes | Test model observers, validation rules, and service container bindings in a sandbox. Key areas: |
- Illuminate\Database\Eloquent\Concerns\HasEvents → observers migration. |
|
- Validator rule changes (e.g., Rule::exists() syntax). |
|
| Symfony Workflow v6.3 Guard Changes | Guards now require strict type hints. Update existing guards to use `string |
| ```php |
public function check(Order $order, string $transition): bool {
return $order->user->can('submit_orders');
}
``` |
| Performance with PHP 8.3 | Benchmark workflow state lookups in PHP 8.3 (JIT optimizations may reduce overhead). Monitor memory usage for high-concurrency workflows. |
| Async Transition Complexity | If using Symfony Messenger, test transactional boundaries (e.g., DB::transaction() + bus->dispatch()). |
| Deprecated Features | Check for removed Symfony Workflow v6.2 features (e.g., action-based transitions are now discouraged). |
queue:work).public function check(Order $order, string $transition): bool { ... }
it('transitions from draft to submitted')->expectsEvents(WorkflowTransitionEvent::class)
->toTransition($order, 'submit');
retrieved/saved events).Rule::active() for guard constraints).symfony/messenger for async transitions (optional).php artisan workflow:list (hypothetical) to inspect workflows.DB::transaction() for atomic transitions.string('tiny') for place storage).HasEvents with observers for workflow-triggered logic.Rule::exists() syntax).// Before (v6.2)
public function check(Order $order, $transition) { ... }
// After (v6.3)
public function check(Order $order, string $transition): bool { ... }
OrderWorkflow) to Laravel 13 + v6.3.use Symfony\Component\Messenger\MessageBusInterface;
$bus->dispatch(new TransitionOrderMessage($order, 'submit'));
workflows.php if using runtime overrides:
// config/cache.php
'stores' => [
'array' => [
'exclude' => ['workflows'],
],
],
it('fails transition without guard')->expectsEvents(WorkflowTransitionFailed::class)
->cannotTransition($order, 'approve');
MessageBusInterface for transition messages.AsyncTransport for background transitions.How can I help you explore Laravel packages today?