PHP code example of letsgoi / laravel-domain-events-messaging

1. Go to this page and download the library: Download letsgoi/laravel-domain-events-messaging library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

letsgoi / laravel-domain-events-messaging example snippets


'providers' => [
    // ...
    Letsgoi\DomainEventsMessaging\DomainEventsMessagingServiceProvider::class,
];

DomainEventsMessagingPublisher::publish('message.subject', 'message content');

'consumer' => [
    // ...

    'events' => [
        'message.subject' => Event::class,
        'message.other' => Job::class,
        // ...
    ]
]

public function __construct(string $message)
bash
php artisan vendor:publish --provider="Letsgoi\DomainEventsMessaging\DomainEventsMessagingServiceProvider" --tag="config"
bash
php artisan domain-events:consume