Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Filament Flow Laravel Package

johnrivera7/filament-flow

Filament Flow is a Laravel/Filament plugin for building and managing flow-based workflows directly inside your admin panel. Model multi-step processes, visualize progress, and move records between stages without leaving your existing resources, forms, and tables. Simple to install and extend.

View on GitHub
Deep Wiki
Context7

Getting Started

  1. Install and publish. Require the package via Composer, then publish its config and any migrations. Run php artisan migrate — Flow order/token persistence is what makes getStatus and refunds workable later.
  2. Register the plugin on your Filament panel. Flow ships a settings page plus a reusable credentials schema, so the fastest path is adding it to your panel provider and filling in apiKey / secretKey / sandbox toggle from the UI rather than hand-editing .env. If your team prefers env-driven config, confirm the settings page falls back to config values before relying on it in CI.
  3. Pick the environment explicitly. Flow has a sandbox base URL distinct from production. Set sandbox mode first, generate test credentials in the Flow dashboard, and only then switch. Keep both credential sets in the settings page so staging and local don't collide.
  4. First use case — a single payment. Inject FlowGateway, call create() with an amount, commerceOrder, subject, email, and your return/confirmation URLs. Persist the returned token alongside your own order record before redirecting. Then send the user to the checkout redirect view (url?token=...).

The three things to read first: the FlowGateway class (it's your whole public API), the credentials schema (to know what's configurable per panel), and the redirect blade view (to know what you can restyle).

Implementation Patterns

Wrap the gateway, don't call it from controllers. FlowGateway is a thin HTTP client. Put it behind your own PaymentService or action class so your domain owns the order state machine and the gateway stays swappable/mockable in tests.

Model the token as first-class state. Treat the Flow token as the join key between your order and theirs. Store it with the order, index it, and use it as the idempotency handle for getStatus and refunds. Never rely on commerceOrder alone — mismatches between your ID and theirs are the most common source of "I paid but the order says pending".

Return flow: confirm, don't trust. Flow sends the user back to your url with ?token=.... Do not mark anything paid on that redirect. Call getStatus($token), verify the status and the amount/currency match your order, then transition state. Use the same code path for a scheduled reconciliation job that sweeps stale pending orders — Flow webhooks/confirmation URLs can be missed, and a poller is cheaper than support tickets.

Separate the three URLs deliberately. url (user return), urlConfirmation (server-to-server), and urlReturn are distinct concerns. Point confirmation at a queued, idempotent endpoint. Make every handler replay-safe: the same token will hit it more than once.

Email-first flows. createEmail() issues a payment request without a redirect — good for dunning, invoicing, or admin-initiated charges. Pair it with a Filament action on the order resource so support staff can resend a payment link without engineering.

Refunds as admin actions. Expose refund as a Filament table action on your order resource, guarded by policy, confirming amount, and writing the Flow response to an audit log. Start with full refunds only; partial refunds need a ledger of what's already been refunded per order or you'll double-refund.

Multi-panel / multi-tenant. Because credentials live in a settings page, the schema is reusable — you can scope credentials per panel or tenant. Decide early whether Flow credentials are global (simplest, recommended for v1) or per-tenant; the latter means the gateway must resolve credentials at call time, not at container build time.

Translations. ES/EN are bundled for the settings page and checkout view. Publish the lang files if you need to change wording, and check that Chilean-specific terms (RUT, CLP formatting) read correctly — the default English strings are a translation, not a localization strategy.

Gotchas and Tips

  • Signature ordering is the classic failure. Flow's HMAC-SHA256 s parameter is computed over parameters sorted alphabetically and concatenated as key=value pairs (then appended as s). If the package does this for you, don't hand-roll requests; if you extend it, any parameter you add must be included in the signing set. A wrong signature returns an error that looks like an auth problem.
  • Don't sign s itself. Obvious in hindsight, a five-minute debugging session every time someone forgets.
  • URL encoding matters. Values with accents, spaces, or & break the signature if signed pre-encoding and sent post-encoding (or vice versa). Pass plain strings to the gateway and let it handle encoding; if you build a custom call, test with a subject containing ñ and &.
  • Currency is CLP and has no decimals. Send integer amounts. A 1500.00 becomes a validation error or, worse, a 100× charge. Add a cast/validation rule at your order boundary rather than trusting callers.
  • Settings caching. Filament settings pages often persist to the DB and get cached. After changing credentials in the UI, clear config/settings caches before concluding the key is wrong. Conversely, don't expect config() in a long-running queue worker to see a credential change made mid-deploy.
  • Token lifetime. Flow tokens expire. A stale pending order needs a new create() call, not a retry of the old token. Surface "regenerate payment link" as a user-visible action.
  • Sandbox vs production base URL leaks. The most expensive bug in this class of package is a production key against a sandbox URL (silent test payments) or vice versa. Log the base URL and masked apiKey prefix on every gateway call at debug level, and add a boot-time guard that refuses to run production base URL with a key that looks like a sandbox key.
  • HTTP client timeout and retries. create() is not safely retryable without idempotency — a timeout may mean the order was created. Wrap create in a guard keyed on your commerceOrder and reconcile via getStatus before retrying.
  • Extension point to look for: whether the gateway resolves the HTTP client from the container (Laravel Http:: facade or an injected client). If it does, you can Http::fake() in tests and add global middleware for logging. If it constructs its own client, you'll need to bind a fake implementation of the gateway itself — check before writing your test suite.
  • Refund response codes. Flow refunds can partially fail or return a pending state. Don't set your order to "refunded" on a 200 alone; verify the returned status field.
  • Version churn risk. v1.0.0 supports Filament 4/5 and Laravel 11–13 in one release. Pin the major version, and if you're on the 4.x/5.x boundary, smoke-test the settings page first — Filament schema API changes between majors are the likeliest breakage point, not the payment calls.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
frankyso/ipaymu
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package
kda/filament-dynamic-navigation
bypersoft/signbox
pairus/product-data
fayne/laravel-filament-cms-core