PHP code example of acdphp / laravel-queued-events
1. Go to this page and download the library: Download acdphp/laravel-queued-events 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/ */
acdphp / laravel-queued-events example snippets
use Acdphp\QueuedEvents\Events\QueuedEvent;
class UserCreatedEvent extends QueuedEvent
{
// Remove the Dispatchable trait
public function __construct(public $object)
{
}
}
// Dispatches if $condition is true
UserCreatedEvent::dispatchIf($condition, ['foo' => 'bar']);
// Dispatches if $condition is false
UserCreatedEvent::dispatchUnless($condition, ['foo' => 'bar']);