›
›
›
  1. docs
  2. ›
  3. byrcsc/laravel-approval
1.x
Browse documentationOpenClose

Getting started

  • Introduction
  • Installation and setup
  • Quick start

Core concepts

  • Workflows and stages
  • Choosing the workflow
  • Approvers and resolvers
  • Requests and state
  • Conditional stages

Approval flow

  • Submitting for approval
  • Recording decisions
  • Attribute drafts
  • Returns and resubmission
  • Bulk decisions

Assignments and deadlines

  • Delegation and reassignment
  • SLAs and escalation

Reading and authorization

  • Eligibility and authorization
  • Queries and timelines
  • Events and listeners
  • Notifications
  • Notification content

Operations

  • Workflow definitions
  • Audit trail and evidence
  • Console commands
  • Testing
  • Troubleshooting

Getting started

  • Introduction
  • Installation and setup
  • Quick start

Core concepts

  • Workflows and stages
  • Choosing the workflow
  • Approvers and resolvers
  • Requests and state
  • Conditional stages

Approval flow

  • Submitting for approval
  • Recording decisions
  • Attribute drafts
  • Returns and resubmission
  • Bulk decisions

Assignments and deadlines

  • Delegation and reassignment
  • SLAs and escalation

Reading and authorization

  • Eligibility and authorization
  • Queries and timelines
  • Events and listeners
  • Notifications
  • Notification content

Operations

  • Workflow definitions
  • Audit trail and evidence
  • Console commands
  • Testing
  • Troubleshooting

byrcsc/laravel-approval · 1.x

Installation and setup.

Install Laravel Approval and publish its configuration before creating the database tables.

Laravel Approval requires PHP 8.3 or 8.4 and Laravel 12 or 13.

The order matters during installation. Configuration values decide the table names and actor key types used by the published migration.

1. Install the package

composer require byrcsc/laravel-approval

Laravel discovers the package and its Approval facade automatically.

2. Publish the configuration

php artisan vendor:publish --tag="approval-config"

This command writes config/approval.php.

Set the model used for requesters, approvers, and other actors:

APPROVAL_USER_MODEL=App\Models\User

Set the key type used by that model before publishing the migration:

APPROVAL_USER_KEY_TYPE=uuid
ValueDatabase column type
intunsignedBigInteger
uuiduuid
ulidulid
stringstring

The setting applies to requester, approver, delegate, actor, and uploader columns. Changing it after data exists requires an application migration.

The model under approval uses a separate approvable_id column. The published migration creates this column as unsignedBigInteger. Edit that migration when your approvable models use another key type.

3. Publish and run the migration

php artisan vendor:publish --tag="approval-migrations"
php artisan migrate

The migration creates eight related tables. Publish the configuration first so the migration uses the table names and actor key type you selected.

If you change table names after migrating, create an application migration to rename the existing tables.

4. Verify the installation

Run the status command:

php artisan approval:status

A new installation reports zero requests in every state. A successful response confirms that Laravel can resolve the package and query its tables.

Optional settings

These environment variables control common behavior:

VariableDefaultPurpose
APPROVAL_USER_MODELApp\Models\UserModel used for actors
APPROVAL_USER_KEY_TYPEintDatabase key type for actor identity columns
APPROVAL_ALLOW_SELF_APPROVALfalseAllow requesters to approve their own work
APPROVAL_NOTIFICATIONS_ENABLEDfalseSend package notifications

The workflows and stages, notifications, and SLAs and escalation pages explain the remaining settings when you need them.

Optional notification files

Publish these files only when you need to change notification text or email markup:

php artisan vendor:publish --tag="approval-translations"
php artisan vendor:publish --tag="approval-views"

See notification content for the published files and available placeholders.

Optional escalation schedule

Deadlines are stored without a scheduler, but reminders and escalation require the sweep command. Add it to routes/console.php when your workflows use deadlines:

use Illuminate\Support\Facades\Schedule;

Schedule::command('approval:escalate')->everyFifteenMinutes();

What to read next

  • Quick start to create a workflow and complete an approval.
  • Workflows and stages to configure approval rules.
  • Troubleshooting if the status command cannot read the package tables.
PreviousIntroductionNextQuick start
View source

On this page

  1. 1. Install the package
  2. 2. Publish the configuration
  3. 3. Publish and run the migration
  4. 4. Verify the installation
  5. Optional settings
  6. Optional notification files
  7. Optional escalation schedule
  8. What to read next