Add notification action foundation
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
namespace Database\Seeders;
|
||||
|
||||
use App\Models\NotificationAction;
|
||||
use App\Models\NotificationDeliveryLog;
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class NotificationDeliveryLogSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
$notificationAction = NotificationAction::query()->orderBy('id')->first();
|
||||
|
||||
if ($notificationAction === null || $notificationAction->deliveryLogs()->exists()) {
|
||||
return;
|
||||
}
|
||||
|
||||
NotificationDeliveryLog::factory()
|
||||
->forNotificationAction($notificationAction)
|
||||
->succeeded()
|
||||
->create([
|
||||
'payload_metadata' => [
|
||||
'project_key' => 'CORE',
|
||||
'ticket_key' => 'CORE-1',
|
||||
],
|
||||
]);
|
||||
|
||||
NotificationDeliveryLog::factory()
|
||||
->forNotificationAction($notificationAction)
|
||||
->retryable()
|
||||
->create([
|
||||
'payload_metadata' => [
|
||||
'project_key' => 'CORE',
|
||||
'ticket_key' => 'CORE-2',
|
||||
],
|
||||
]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user