PHPackages                             laravelplus/automations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. laravelplus/automations

ActiveLibrary

laravelplus/automations
=======================

A powerful automation system for Laravel applications

10PHP

Since Jul 24Pushed 9mo agoCompare

[ Source](https://github.com/LaravelPlus/automations)[ Packagist](https://packagist.org/packages/laravelplus/automations)[ RSS](/packages/laravelplus-automations/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

LaravelPlus Automations
=======================

[](#laravelplus-automations)

A powerful automation system for Laravel applications, built with modern PHP 8.4+ and Laravel 12+ features.

🚀 Features
----------

[](#-features)

- **Modern PHP 8.4+**: Final classes, strict types, return types, readonly properties
- **Laravel 12+**: Latest Laravel features and best practices
- **Repository Pattern**: Clean separation of data access logic
- **Action-Based Controllers**: Single responsibility actions for better maintainability
- **Multiple Trigger Types**: Manual, Schedule, Webhook, Event
- **Rich Action Library**: HTTP requests, emails, database queries, file operations, queue jobs, custom code
- **Web Interface**: Beautiful dashboard for managing workflows
- **API Endpoints**: Full REST API for integration
- **Security Features**: Webhook signature verification, IP whitelisting, rate limiting
- **Monitoring**: Execution history, statistics, and logging

📋 Requirements
--------------

[](#-requirements)

- PHP 8.4+
- Laravel 12+
- MySQL/PostgreSQL/SQLite

🛠 Installation
--------------

[](#-installation)

1. **Install the package**:

```
composer require laravelplus/automations
```

2. **Publish the configuration**:

```
php artisan vendor:publish --tag=automations-config
```

3. **Run migrations**:

```
php artisan migrate
```

4. **Add to your `.env`**:

```
AUTOMATIONS_ENABLED=true
AUTOMATIONS_QUEUE=default
```

🏗 Architecture
--------------

[](#-architecture)

### Repository Pattern

[](#repository-pattern)

```
// Interface
interface WorkflowRepositoryInterface
{
    public function findById(int $id): ?Workflow;
    public function create(array $data): Workflow;
    public function update(Workflow $workflow, array $data): Workflow;
    // ...
}

// Implementation
final class WorkflowRepository implements WorkflowRepositoryInterface
{
    // Implementation with modern PHP features
}
```

### Action-Based Controllers

[](#action-based-controllers)

```
final readonly class CreateWorkflowAction
{
    public function __construct(
        private WorkflowRepositoryInterface $workflowRepository
    ) {}

    public function __invoke(Request $request): JsonResponse|RedirectResponse
    {
        // Single responsibility action
    }
}
```

### Modern Models

[](#modern-models)

```
final class Workflow extends Model
{
    use HasFactory, SoftDeletes;

    protected $casts = [
        'status' => WorkflowStatus::class,
        'trigger_type' => TriggerType::class,
    ];

    public function isReadyForExecution(): bool
    {
        return $this->status === WorkflowStatus::ACTIVE &&
            ($this->next_execution_at === null || $this->next_execution_at  'Daily Report',
    'trigger_type' => TriggerType::SCHEDULE,
    'trigger_config' => ['cron_expression' => '0 9 * * *'],
    'definition' => [
        'nodes' => [
            [
                'id' => 'trigger',
                'type' => 'trigger',
                'data' => ['type' => 'schedule']
            ],
            [
                'id' => 'http_request',
                'type' => 'http_request',
                'data' => [
                    'url' => 'https://api.example.com/data',
                    'method' => 'GET'
                ]
            ],
            [
                'id' => 'email',
                'type' => 'email',
                'data' => [
                    'to' => 'admin@example.com',
                    'subject' => 'Daily Report',
                    'body' => '{{http_request.response}}'
                ]
            ]
        ],
        'connections' => [
            ['from' => 'trigger', 'to' => 'http_request'],
            ['from' => 'http_request', 'to' => 'email']
        ]
    ],
    'status' => WorkflowStatus::ACTIVE,
]);
```

### Executing Workflows

[](#executing-workflows)

```
// Manual execution
$execution = Automation::executeWorkflow($workflow, ['custom_data' => 'value']);

// Via API
POST /api/automations/workflows/{workflow}/execute
{
    "input_data": {
        "user_id": 123,
        "custom_field": "value"
    }
}
```

### Webhook Triggers

[](#webhook-triggers)

```
// Create webhook-enabled workflow
$workflow = Workflow::create([
    'name' => 'Webhook Handler',
    'trigger_type' => TriggerType::WEBHOOK,
    'webhook_config' => [
        'name' => 'Order Created',
        'method' => 'POST',
        'require_signature' => true,
        'allowed_ips' => ['192.168.1.1']
    ],
    // ... workflow definition
]);

// Webhook endpoint: POST /api/automations/webhook/{endpoint}
```

🔧 Configuration
---------------

[](#-configuration)

```
// config/automations.php
return [
    'enabled' => env('AUTOMATIONS_ENABLED', true),
    'queue' => env('AUTOMATIONS_QUEUE', 'default'),
    'timeout' => env('AUTOMATIONS_TIMEOUT', 300),
    'max_retries' => env('AUTOMATIONS_MAX_RETRIES', 3),
    'cleanup_days' => env('AUTOMATIONS_CLEANUP_DAYS', 30),
];
```

🎛 Console Commands
------------------

[](#-console-commands)

```
# Run scheduled workflows
php artisan automations:run-scheduled

# Dry run to see what would execute
php artisan automations:run-scheduled --dry-run

# List workflows
php artisan automations:list

# List with filters
php artisan automations:list --status=active --type=schedule --format=json
```

🌐 Web Interface
---------------

[](#-web-interface)

Visit `/automations` to access the dashboard:

- **Dashboard**: Overview with statistics
- **Workflows**: Create, edit, and manage workflows
- **Executions**: Monitor execution history
- **Webhooks**: Manage webhook endpoints

🔌 API Endpoints
---------------

[](#-api-endpoints)

### Workflows

[](#workflows)

```
GET    /api/automations/workflows
POST   /api/automations/workflows
GET    /api/automations/workflows/{id}
PUT    /api/automations/workflows/{id}
DELETE /api/automations/workflows/{id}
POST   /api/automations/workflows/{id}/execute
POST   /api/automations/workflows/{id}/activate
POST   /api/automations/workflows/{id}/deactivate
```

### Executions

[](#executions)

```
GET    /api/automations/executions
GET    /api/automations/executions/{id}
POST   /api/automations/executions/{id}/retry
POST   /api/automations/executions/{id}/cancel
```

### Webhooks

[](#webhooks)

```
POST   /api/automations/webhook/{endpoint}
GET    /api/automations/webhook/{endpoint}
```

🛡 Security
----------

[](#-security)

- **Webhook Signatures**: HMAC-SHA256 signature verification
- **IP Whitelisting**: Restrict webhook access by IP
- **Rate Limiting**: Prevent abuse with configurable limits
- **Input Validation**: Comprehensive validation for all inputs
- **Sandboxed Code**: Safe execution of custom code

📊 Monitoring
------------

[](#-monitoring)

- **Execution History**: Complete audit trail
- **Statistics**: Success rates, execution times
- **Logging**: Detailed logs for debugging
- **Error Handling**: Graceful error recovery

🧪 Testing
---------

[](#-testing)

```
# Run tests
composer test

# Run with coverage
composer test -- --coverage
```

📝 License
---------

[](#-license)

This package is open-sourced software licensed under the [MIT license](LICENSE).

🤝 Contributing
--------------

[](#-contributing)

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Add tests
5. Submit a pull request

📚 Documentation
---------------

[](#-documentation)

For detailed documentation, visit [docs.laravelplus.com/automations](https://docs.laravelplus.com/automations).

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance40

Moderate activity, may be stable

Popularity2

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity14

Early-stage or recently created project

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/4e4629de002c40aef796e5b320091892f0b7b35b62497260c52cef3eb721eed1?d=identicon)[Nejcc](/maintainers/Nejcc)

### Embed Badge

![Health badge](/badges/laravelplus-automations/health.svg)

```
[![Health](https://phpackages.com/badges/laravelplus-automations/health.svg)](https://phpackages.com/packages/laravelplus-automations)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
