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