Looking to hire Laravel developers? Try LaraJobs

eloquent-external-events maintained by laravel-tool

Description
Eloquent external events via API
Last update
2023/09/20 08:58 (dev-main)
License
Links
Downloads
1 155

Comments
comments powered by Disqus

Eloquent external events via API

Setup

  1. Add trait ExternalEvents to model
  2. Add eloquent_external_events config:
    return [
        'connections' => [
            'default' => [
                'endpoint' => env('ELOQUENT_EXTERNAL_EVENTS_API_ENDPOINT'),
                'token' => env('ELOQUENT_EXTERNAL_EVENTS_API_TOKEN'),
            ],
        ],
    ];
    
  3. Add name of external model:
    public function externalModel(): string
    {
        return 'App\Models\Application';
    }
    
  4. Add connection name to model from eloquent_external_events config:
    public function getExternalEventConnectionName(): string
    {
        return 'kyc';
    }
    
  5. See https://github.com/laravel-tool/eloquent-external-events-server