Файловый менеджер - Редактировать - /home/clickysoft/public_html/somni.clickysoft.net/app/Listeners/NotificationToTenantAndLandlordInvite.php
Назад
<?php namespace App\Listeners; use App\Events\InvitationSent; use Illuminate\Contracts\Queue\ShouldQueue; use Illuminate\Queue\InteractsWithQueue; use App\Interfaces\NotificationRepositoryInterface; use App\Interfaces\UserRepositoryInterface; use App\Repositories\NotificationRepository; use App\Repositories\UserRepository; class NotificationToTenantAndLandlordInvite { private NotificationRepositoryInterface $notificationInterfaceObj; private UserRepositoryInterface $userInterfaceObj; /** * Create the event listener. */ public function __construct(NotificationRepository $notifRepo,UserRepository $userRepo) { $this->notificationInterfaceObj = $notifRepo; $this->userInterfaceObj = $userRepo; } /** * Handle the event. */ public function handle(InvitationSent $event): void { //First Send Landlord A notification $title = 'Invitation Sent'; $message = 'Invitation Sent to '.$event->email.'. Upon accepting you will be notified!'; $fl = $this->notificationInterfaceObj->CreateAndSendNotification($event->user,$title,$message); //Second send Tenant A Notification if tenant Exists $tenant = $this->userInterfaceObj->getUserByKey('email',$event->email); if($tenant){ $title = 'Invitation To Unit '.$event->unit->name; $message = 'Invitation Recieved for Unit '.$event->unit->name.'. Please enter the invitation code recieved via email.'; $ft = $this->notificationInterfaceObj->CreateAndSendNotification($tenant,$title,$message); } } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка