> laravel-transactions-and-consistency
Wrap multi-write operations in transactions; use dispatchAfterCommit and idempotency patterns to ensure consistency
fetch
$
curl "https://skillshub.wtf/noartem/skills/laravel-transactions-and-consistency?format=md"SKILL.md•laravel-transactions-and-consistency
Transactions and Consistency
Ensure multi-step changes are atomic; make retries safe.
Commands
DB::transaction(function () use ($order, $payload) {
$order->update([...]);
$order->items()->createMany($payload['items']);
OrderUpdated::dispatch($order); // or flag for after-commit
});
// Listener queued after commit
class SendInvoice implements ShouldQueue {
public $afterCommit = true;
}
Patterns
- Use
DB::transactionto wrap write sequences and related side-effects - Prefer
$afterCommitordispatchAfterCommit()for events / jobs - Make jobs idempotent (check existing state, use unique constraints)
- Use
lockForUpdate()for row-level coordination when needed - Validate invariants at the boundary before starting the transaction
> related_skills --same-repo
> vue3-component-decomposition
Decompose large Vue 3 components into focused SFCs and composables with explicit contracts, simple templates, and SSR-safe side effects.
> shadcn-vue
shadcn-vue for Vue/Nuxt with Reka UI components and Tailwind. Use for accessible UI, Auto Form, data tables, charts, dark mode, MCP server setup, or encountering component imports, Reka UI errors.
> laravel-template-method-and-plugins
Stabilize workflows with Template Method or Strategy; extend by adding new classes instead of editing core logic
> laravel-task-scheduling
Schedule tasks with safety; use withoutOverlapping, onOneServer, and visibility settings for reliable cron execution
┌ stats
installs/wk0
░░░░░░░░░░github stars6
█░░░░░░░░░first seenMar 17, 2026
└────────────