Skip to content

Commit 62f16e2

Browse files
committed
remove redundnant property exists, convert custom model test to enum
1 parent 5bada96 commit 62f16e2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/Notifications/BaseNotification.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function getSubscriptionFromNotifiable(object $notifiable): ?Notification
7373
->where('notification_template_id', self::getTemplate()->id);
7474

7575
// If this notification is for a specific model, include it in the query
76-
if (property_exists($this, 'customModel') && $this->customModel) {
76+
if ($this->customModel) {
7777
$query->where('notifiable_type', get_class($this->customModel))
7878
->where('notifiable_id', $this->customModel->id);
7979
}

tests/TestNotifications/CustomModelNotification.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace Eugenefvdm\NotificationSubscriptions\Tests\TestNotifications;
44

5+
use Eugenefvdm\NotificationSubscriptions\Enums\RepeatFrequency;
56
use Eugenefvdm\NotificationSubscriptions\Notifications\BaseNotification;
67
use Illuminate\Bus\Queueable;
78
use Illuminate\Contracts\Queue\ShouldQueue;
@@ -12,7 +13,7 @@ class CustomModelNotification extends BaseNotification
1213
{
1314
use Queueable;
1415

15-
protected static ?string $repeatFrequency = 'weekly';
16+
protected static ?RepeatFrequency $repeatFrequency = RepeatFrequency::Weekly;
1617

1718
public ?Model $customModel;
1819

0 commit comments

Comments
 (0)