// Include the class
use \LaravelSendgridWebhooks\Models\SendgridWebhookEvent;
////////////////////
// Get all records:
SendgridWebhookEvent::all();
// Get all by message ID:
$sendgridMessageId = 'abc123';
SendgridWebhookEvent::where('sg_message_id', $sendgridMessageId)->all();
// Get all by event ID:
$sendgridEventId = 'xyz987';
SendgridWebhookEvent::where('sg_event_id', $sendgridEventId)->all();
// Get all by event type
SendgridWebhookEvent::where('event', LaravelSendgridWebhooks\Enums::PROCESSED)->all();
SendgridWebhookEvent::where('event', LaravelSendgridWebhooks\Enums::DEFERRED)->all();
SendgridWebhookEvent::where('event', LaravelSendgridWebhooks\Enums::DELIVERED)->all();
SendgridWebhookEvent::where('event', LaravelSendgridWebhooks\Enums::OPEN)->all();
SendgridWebhookEvent::where('event', LaravelSendgridWebhooks\Enums::CLICK)->all();
SendgridWebhookEvent::where('event', LaravelSendgridWebhooks\Enums::BOUNCE)->all();
SendgridWebhookEvent::where('event', LaravelSendgridWebhooks\Enums::DROPPED)->all();
SendgridWebhookEvent::where('event', LaravelSendgridWebhooks\Enums::SPAMREPORT)->all();
SendgridWebhookEvent::where('event', LaravelSendgridWebhooks\Enums::UNSUBSCRIBE)->all();
SendgridWebhookEvent::where('event', LaravelSendgridWebhooks\Enums::GROUP_UNSUBSCRIBE)->all();
SendgridWebhookEvent::where('event', LaravelSendgridWebhooks\Enums::GROUP_RESUBSCRIBE)->all();
// Count all bounces
SendgridWebhookEvent::where('event', LaravelSendgridWebhooks\Enums::BOUNCE)->count();
// Get a record
$event = SendgridWebhookEvent::first();
// Included with all event types
$event->timestamp;
$event->email;
$event->event;
$event->categories;
$event->sg_event_id;
$event->sg_message_id;
$event->payload; // Array of full payload sent by Sendgrid
// Get a record
$event = SendgridWebhookEvent::first();
// Access the reason attribute,
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.