controller refactoring part 7

This commit is contained in:
Peter Papp
2021-07-20 12:22:48 +02:00
parent 0232a7abeb
commit dc98c839a2
17 changed files with 275 additions and 216 deletions

View File

@@ -0,0 +1,20 @@
<?php
namespace Domain\Sharing\Actions;
use Illuminate\Support\Facades\Notification;
use Domain\Sharing\Notifications\SharedSendViaEmail;
class SendViaEmailAction
{
public function __invoke(
array $emails,
string $token,
): void {
foreach ($emails as $email) {
Notification::route('mail', $email)
->notify(
new SharedSendViaEmail($token)
);
}
}
}