Download the PHP package dbflowlabs/core without Composer

On this page you can find all versions of the php package dbflowlabs/core. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package core

DBFlow Core

Tests Latest Release

Model-first workflow runtime for Laravel applications.

DBFlow Core lets you add approval workflows, tasks, transitions, rejection flows, and audit logs to any Eloquent model without building a heavy BPM system from scratch.

It is the open-source runtime foundation of the DBFlow ecosystem. Host-specific business adapters, Filament UI packages, and the visual workflow Builder are distributed separately.

[!NOTE] DBFlow Core 1.1.0 extends the stable 1.0 runtime with additive contracts (context, delegation, SLA, reliable actions, outbound webhooks). See CHANGELOG.md.

Contents

Package Overview

Item Value
Package name dbflowlabs/core
Namespace DbflowLabs\Core
License MIT
Repository github.com/dbflow-labs/dbflow-core
Default branch main
Stability Stable (1.1.0)
Author Baron Wang [email protected]
Documentation dbflow.dev/docs
Laravel compatibility 13.x
PHP requirements 8.3, 8.4

What Core Provides

DBFlow Core provides the runtime foundation required for deterministic, schema-driven workflow execution:

[!NOTE] Core focuses entirely on the workflow runtime engine. It contains no frontend assets, Filament resources, visual canvas, or host-specific business models.

Requirements

Installation

Packagist Installation

Releases are tagged on GitHub, for example:

Hosts on 1.0.x can upgrade with composer require dbflowlabs/core:^1.1 — see UPGRADE-1.1.md.

Laravel Integration

Service Provider

The core service provider is registered automatically via Laravel package discovery:

Publish Configuration

This publishes:

Publishing the configuration file is optional, but recommended when the host application needs to customize authentication, user resolution, or runtime feature flags.

Publish Migrations

DBFlow Core creates only dbflow_* tables, preserving schema separation from host application tables.

During local package development, migrations may also be loaded directly through Laravel's loadMigrationsFrom() behavior. Publishing migrations is optional — a host application can run php artisan migrate without publishing, as long as the package service provider is registered.

Configuration

Publish the package config (optional but recommended):

The package ships a framework-neutral config/dbflow.php. It does not hard-code a host user model or guard — set those in your application .env (or override the published file in the host).

Package defaults (illustrative — see the published file for the exact source):

v1.1 configuration keys are documented in docs/reference/v1.1-configuration.md.

Host example — typical Laravel app after publish (you may add env() fallbacks in your copy only):

Recommended .env for that host example:

ConfigUserResolver supports integer and string primary keys at runtime. User references are stored as strings in dbflow_* tables.

[!NOTE] Set DBFLOW_ENABLED=false to disable the workflow runtime. When disabled, DBFlow::start() / approve() / reject() / cancel() / reassign() / delegation APIs throw WorkflowNotAvailableException, timeout/SLA/action artisan commands that require the runtime fail, and runtime action bindings (StartWorkflow, etc.) are not registered. Definition-management bindings remain available (registerDefinitionProvider, registerAssigneeResolver, etc.), migrations still load, and php artisan dbflow:sync / dbflow:validate remain registered so hosts can sync or validate definitions before re-enabling.

Minimal Usage

Code-first integration: register → sync → attach model → run → guard host actions.

1. Register Runtime Definitions

Register workflow definitions, assignee resolvers, and hooks during application boot. A host service provider is usually the best place for this.

A WorkflowDefinitionProvider returns a validated array definition (nodes, transitions, approval config). See DbflowLabs\Core\Contracts\WorkflowDefinitionProvider and package tests under tests/Feature/SyncWorkflowDefinitionsTest.php.

2. Sync Definitions to the Database

[!IMPORTANT] Registering a provider alone is not enough for DBFlow::start(). The runtime resolves an active published row from dbflow_workflow_versions. After registration, sync code-first definitions into dbflow_* tables.

Call SyncWorkflowDefinitions from a deploy hook, or use the official Artisan command:

Programmatic alternative:

Validate definitions in CI:

Process overdue approval tasks on the legacy timeout path (schedule via cron, for example every minute):

When using v1.1 SLA and reliable actions, also schedule dispatch/recover commands and run a queue worker — see docs/operations/queue-and-scheduler.md. Check readiness with:

Alternative for interactive or UI-owned workflows: CreateWorkflowDraftPublishWorkflowDraft (see package actions and Filament packages).

Re-run sync after changing a code-first definition. UI-owned workflows (source = ui) are not overwritten as the active version pointer; see SyncWorkflowDefinitions source for details.

3. Attach Workflows to Host Models

Use the HasWorkflow trait on Eloquent models that participate in workflows.

Recommended for most hosts — implement Workflowable for business key and display metadata used in logs and UI adapters:

For condition routing — also implement WorkflowContextInterface so condition transitions can read business variables:

WorkflowContextInterface is separate from Workflowable. Models that need condition nodes should implement both (or pass metadata['variables'] when calling DBFlow::start()).

When binding_mode is code (default), start workflows explicitly:

When binding_mode is ui, matching published workflows with a model_type binding may auto-start on Model::created. ERP-style hosts usually keep code and trigger from business actions (submit, confirm, etc.). Auto-start runs inside the created event, not the model's own persistence transaction; if a matching workflow fails to start (e.g. a misconfigured assignee resolver), the exception is reported via report() and swallowed so the model is still created and other matching workflows still get a chance to start — it does not roll back model creation or block sibling workflows.

4. Start a Workflow

Start a workflow for an Eloquent model after sync has published the definition:

[!NOTE] Metadata contract (stable): Core persists the entire $metadata array on the workflow instance. It does not assign special meaning to keys such as submit_comment — naming conventions are host-defined. For condition nodes, prefer WorkflowContextInterface::getWorkflowVariables(); otherwise pass metadata['variables'].

5. Approve or Reject a Task

Approve a pending task:

Reject a pending task (default strategy returns flow toward the starter):

6. Cancel a Running Workflow

DBFlow::cancel() stops a running instance — similar in product language to "withdraw", but it is a distinct Core API from approve/reject:

What Core does:

What Core does not do:

Terminal status Typical host canConfirm strategy (examples only)
running Block until approved or cancelled
approved Allow downstream business action
rejected Block until a new start() completes successfully
cancelled Host choice: allow action, require re-submit, or keep blocked

7. Reassign a Pending Task

DBFlow::reassign() replaces a single pending assignment with a new assignee. It does not advance the workflow.

What Core does:

What Core does not do:

8. Delegation (v1.1)

Create a time-bounded delegation rule, then optionally migrate matching pending tasks:

See docs/architecture/reassignment-and-delegation.md.

9. Task Timeouts and SLA (v1.1)

Legacy timeout (v1.0 path) — approval nodes may declare:

Schedule:

v1.1 SLA extends approvals with reminders, overdue notifications, and escalation via persisted WorkflowSlaEvent rows (dbflow:sla-dispatch / dbflow:sla-recover). Tasks on the v1.1 SLA path are excluded from dbflow:process-timeouts. See docs/architecture/sla-runtime.md.

10. Query Workflow State on Models

Models using HasWorkflow can inspect runtime state without raw SQL:

Use these helpers in host guards (for example, disable a Filament Confirm action while hasRunningWorkflow() is true).

11. Action Node Failures

Action nodes execute registered ActionHandler implementations during traversal. When a handler throws:

Default (fire-and-forget):

Opt-in abort (stop_on_error: true):

Set DBFLOW_EXPRESSION_STRICT=true when condition nodes should reject invalid or missing variables instead of treating them as false.

Runtime API Summary

Use DbflowLabs\Core\DBFlow as the single runtime entry point for workflow operations.

Method Purpose Returns
start($workflowKey, $workflowable, $startedBy = null, $metadata = []) Create a running instance WorkflowInstance
approve($task, $actor = null, $comment = null) Approve a pending task WorkflowInstance
reject($task, $actor = null, $comment = null, $strategy, $targetNodeKey = null) Reject a pending task WorkflowInstance
cancel($instance, $actor = null, $comment = null) Cancel a running instance WorkflowInstance
reassign($task, $fromActor, $toUserId, $comment = null, $idempotencyKey = null, $assignmentId = null) Reassign a pending assignment to another user WorkflowInstance
createDelegation(...) Create a time-bounded delegation rule WorkflowDelegation
revokeDelegation($delegation, $revokedBy = null, $reason = null) Revoke an active delegation WorkflowDelegation
migratePendingTasksToDelegate($delegation, ...) Migrate matching pending tasks to the delegate array
registerDefinitionProvider($registry, $provider) Boot-time code definition registration void
registerAssigneeResolver($registry, $key, $resolver) Boot-time assignee resolver registration void
registerWorkflowHooks($registry, $workflowKey, $hooks) Boot-time lifecycle hooks void
registerTaskHooks($registry, $workflowKey, $hooks) Boot-time task-level hooks void

Registration helpers are usually called from a host service provider. Runtime actions (start / approve / reject / cancel / reassign / delegation APIs) are usually called from host services, controllers, or UI actions.

Assignee Types (Runtime)

Approval nodes declare assignees under config.assignees. The schema lists four types; open-core runtime support differs:

assignees.type Supported at runtime Notes
user Yes Single user id in value (string or int). Fine for demos; use callback in production.
callback Yes callback (or value) must match a key registered via DBFlow::registerAssigneeResolver().
permission (resolver alias) Yes value is a resolver registry key, not a Laravel Gate name or Spatie permission string.
role No Listed in the schema for forward compatibility, but rejected by validators during code sync. Use callback and resolve roles in the host.

Examples:

Anti-pattern:

WorkflowDefinitionSchema::runtimeSupportedAssigneeTypes() is the canonical list for code-first definitions.

Assignee Resolution Prerequisites

Before exposing a Submit for approval action in your UI, verify:

  1. The workflow is published (SyncWorkflowDefinitions or PublishWorkflowDraft) and is_enabled
  2. Every approval node can resolve to at least one assignee user id at runtime
  3. Every callback / permission (resolver alias) key has a matching AssigneeResolver registered at boot

If resolution fails or the workflow is missing, start() throws (for example InvalidWorkflowDefinitionException). Core does not fall back to a default approver.

Host Responsibilities

Core is a runtime engine. The following are not provided and must be implemented (or installed via dbflowlabs/filament) in the host application:

Responsibility Provided by Core? Typical host implementation
Submit / start UI No Filament Action, API endpoint, or service method calling DBFlow::start()
Approve / reject UI No Task inbox page, or dbflowlabs/filament
Withdraw / cancel UI No Action calling DBFlow::cancel() after host authorization
Business action guards No Before confirm / post / ship, check hasRunningWorkflow() or latest terminal status
Assignee configuration No AssigneeResolver implementations, deploy-time sync
Coexistence with other approval systems No Host config to choose one engine per document type

UI options:

Core does not know about Filament, ERP document types, or plugin mutual-exclusion switches — those remain host concerns.

Host Integration Checklist

  1. composer require dbflowlabs/core (pair with dbflowlabs/filament:^1.0 when using the Filament adapter).
  2. php artisan vendor:publish --tag=dbflow-config and set DBFLOW_AUTH_*.
  3. php artisan migrate (migrations load from the package; publishing optional).
  4. Implement WorkflowDefinitionProvider(s) and register them in a host service provider.
  5. Register AssigneeResolver(s) for every callback / permission (resolver alias) key used in definitions.
  6. Run php artisan dbflow:sync (or call SyncWorkflowDefinitions from a deploy hook).
  7. Add HasWorkflow (+ Workflowable / WorkflowContextInterface as needed) to host models.
  8. Implement host UI or services that call DBFlow::start() / approve() / reject() / cancel().
  9. Implement business guards (for example, block confirm while a workflow is running).
  10. Optionally install dbflowlabs/filament for a standard approval inbox instead of building UI from scratch.

Package Boundaries

DBFlow Core is intentionally small and runtime-focused.

The following are outside this package:

Unresolved premium action types raise PremiumFeatureMissingException.

Premium or host-specific action handlers can be registered through ActionManager, or provided by separate extension packages.

DBFlow Ecosystem

DBFlow is designed as a layered ecosystem:

Package Role License
dbflowlabs/core Runtime engine MIT
dbflowlabs/filament Standard Filament UI integration MIT / open-source
dbflowlabs/filament-pro Visual workflow Builder and advanced UI features Commercial

Core runs the workflow. Filament packages provide user interfaces. Host applications provide business adapters.

Filament integration contract (1.0+)

Cross-package contracts for pending-task queries, runtime actions, events, and version alignment are documented in:

Target version pairing for 1.1:

Package Constraint
dbflowlabs/core ^1.1
dbflowlabs/filament ^1.1 (requires core ^1.1)
dbflowlabs/filament-pro ^1.1 (optional; requires core + filament ^1.1)

Hosts remaining on the 1.0 UI packages should stay on dbflowlabs/core:^1.0 until Filament/Pro are upgraded together.

Choosing a UI path:

Development

Install dependencies:

Validate the package metadata:

Run the test suite:

The CI pipeline validates the package against PHP 8.3 and 8.4 with PHPUnit, PHPStan, and coverage gates (runtime API ≥ 80%, src/ ≥ 70%).

API stability

From 1.0.0, these surfaces remain frozen until the next major release:

Additive in 1.1.0 (compatible with the 1.0 freeze; new public methods and events):

Draft and builder management actions are marked @internal and are not covered by the stability guarantee. Use artisan commands or the Filament Builder package instead of binding those classes directly.

Automated contract tests: EcosystemContractTest, PublicApiContractTest, V10CompatibilityTest.

Versioning

DBFlow Core 1.1.0 is the current stable release (built on the frozen 1.0 public API).

Support

For architecture alignment or integration questions, open a GitHub Issue or contact:

License

DBFlow Core is open-sourced software licensed under the MIT license.


All versions of core with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
illuminate/auth Version ^13.0
illuminate/console Version ^13.0
illuminate/contracts Version ^13.0
illuminate/database Version ^13.0
illuminate/support Version ^13.0
symfony/expression-language Version ^7.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package dbflowlabs/core contains the following files

Loading the files please wait ...