1 | <?php |
||||||
2 | |||||||
3 | namespace PeriodicNotice\Concerns; |
||||||
4 | |||||||
5 | use Illuminate\Database\Eloquent\Relations\MorphMany; |
||||||
6 | use PeriodicNotice\Models\PeriodicSentEntry; |
||||||
7 | |||||||
8 | /** |
||||||
9 | * Trait related to notification receiver. |
||||||
10 | * |
||||||
11 | * @mixin \PeriodicNotice\Contracts\NotificationReceiver |
||||||
12 | * @mixin \Illuminate\Database\Eloquent\Model |
||||||
13 | */ |
||||||
14 | trait HasPeriodicNotice |
||||||
15 | { |
||||||
16 | 1 | public function periodicSentEntries(): MorphMany |
|||||
17 | { |
||||||
18 | 1 | return $this->morphMany(PeriodicSentEntry::class, 'receiver'); |
|||||
0 ignored issues
–
show
Bug
introduced
by
![]() |
|||||||
19 | } |
||||||
20 | |||||||
21 | 1 | public function sendNowPeriodicalNotification(string $group = 'default') |
|||||
22 | { |
||||||
23 | 1 | $this->periodicNoticeDirector($group)->sendPeriodicalNotification($this); |
|||||
0 ignored issues
–
show
It seems like
periodicNoticeDirector() must be provided by classes using this trait. How about adding it as abstract method to this trait?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
![]() |
|||||||
24 | } |
||||||
25 | |||||||
26 | 1 | public function sendPeriodicalNotification(string $group = 'default') |
|||||
27 | { |
||||||
28 | 1 | dispatch(function () use ($group) { |
|||||
29 | $this->sendNowPeriodicalNotification($group); |
||||||
30 | 1 | })->onConnection(config('periodic-notice.defaults.connection')) |
|||||
31 | 1 | ->onQueue(config('periodic-notice.defaults.queue')); |
|||||
32 | } |
||||||
33 | } |
||||||
34 |