Browse Source

merge haj mohammad

pull/6/head
mahdihty 4 years ago
parent
commit
804a96f77f
  1. 29
      app/Listeners/BusinessUpdateListener.php

29
app/Listeners/BusinessUpdateListener.php

@ -2,26 +2,10 @@
namespace App\Listeners; namespace App\Listeners;
use App\Models\User;
use App\Models\Business;
use Illuminate\Support\Arr;
<<<<<<< Updated upstream
use App\Channels\FcmChannel;
use App\Events\BusinessUpdate;
use App\Events\BusinessUserCreate;
use App\Notifications\DBNotification;
use App\Notifications\FcmNotification;
use App\Notifications\MailNotification;
use Illuminate\Queue\InteractsWithQueue;
=======
use App\Events\BusinessUpdate; use App\Events\BusinessUpdate;
use App\Events\BusinessUserCreate;
use App\Models\Business;
use App\Notifications\DBNotification; use App\Notifications\DBNotification;
use App\Notifications\MailNotification; use App\Notifications\MailNotification;
use Illuminate\Queue\InteractsWithQueue;
>>>>>>> Stashed changes
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Support\Facades\Notification; use Illuminate\Support\Facades\Notification;
class BusinessUpdateListener class BusinessUpdateListener
@ -29,7 +13,6 @@ class BusinessUpdateListener
public function handle(BusinessUpdate $event) public function handle(BusinessUpdate $event)
{ {
$payload = $event->message; $payload = $event->message;
<<<<<<< Updated upstream
$business = Business::findOrFail($payload->business)->load('owners'); $business = Business::findOrFail($payload->business)->load('owners');
$this->checkWalletIsRunningLow($business); $this->checkWalletIsRunningLow($business);
@ -93,16 +76,6 @@ class BusinessUpdateListener
$business->update(['suspended_at' => now(),]); $business->update(['suspended_at' => now(),]);
Notification::send($business->owners, new MailNotification($message)); Notification::send($business->owners, new MailNotification($message));
Notification::send($business->owners, new DBNotification($message)); Notification::send($business->owners, new DBNotification($message));
=======
$wallet = $payload?->data?->diff?->wallet;
$owners = Business::findOrFail($payload->business)->owners;
$message = ['body' => 'Test'];
if ($wallet < 0) {
Notification::send($owners, new MailNotification($message));
Notification::send($owners, new DBNotification($message));
>>>>>>> Stashed changes
} }
} }
} }
Loading…
Cancel
Save