Category : notifications

In my Laravel application berkayk/onesignal-laravel package is used for notifications. And currently, it is not working and I need to log the onesignal response so I can debug the issue. Below is my function: $workspace = !empty(Config::get(‘system.one_signal_workspace’))?Config::get(‘system.one_signal_workspace’):false; $notification = null; if(!$workspace){ Log::alert([‘Workspace Not Found’]); } if(!empty($data)){ if(isset($data[‘type’])) $obj->type = $data[‘type’]; if(isset($data[‘notification_obj’])) $obj->notification = $data[‘notification_obj’]; try ..

Read more

I have closure on saving model, where I need to check logic and if my if statement fails I want to throw error message, something like this: static::saving(function ($model) { if($model->default == ‘1’) { $model->default = ‘0’; //sweetAlert alert()->message(‘Message’, ‘Optional Title’); //notify notify()->success(‘Laravel Notify is awesome!’); } }); I tried both sweetAlert: https://github.com/uxweb/sweet-alert and notify: ..

Read more

I was trying to make some emails to send when someone register. here’s my code AppHttpApiNotificationEmail <?php namespace AppHttpApiNotification; use AppAbstractsHttpApiController; use AppNotificationsEmailEmailNotification; use AppHttpRequestsEmailEmail as Request; use IlluminateSupportFacadesMail; class Email extends ApiController { /** * email sent. * * @param Request $request * * @return Response */ public function sent(Request $request) { $to = ..

Read more

i need to send the email for the owner of product when user order this product… everything works well, but really i dont know the idea…. this is the Notification class: <?php namespace AppNotifications; use IlluminateBusQueueable; use IlluminateContractsQueueShouldQueue; use IlluminateNotificationsMessagesMailMessage; use IlluminateNotificationsNotification; class OrderNotification extends Notification { use Queueable; private $insertOrderData; /** * Create a ..

Read more

I’m trying to implement the Database Notifications in Laravel 6 and I’m getting this error when I try to migrate my database, I don’t know how to solve it since the foreign keys is not defined inside the notifications table creation migration, this is the up method from the migration: public function up() { Schema::create("notifications", ..

Read more

So I am setting up a exception handler that send a Slack notification every time an exception happens in the application, I have also setup this when a Complaint(Model) is created and that work fine. But in my Exception/Handle.php I have this setup. Notification::route(‘slack’, env(‘LOG_SLACK_WEBHOOK_URL’))->notify(new ExceptionCreated($exception)); The webhook does exist and it does work. And ..

Read more

I want to make a notification that renames the Notification table to the database and acts according to the model, where should I add and update it. App/notification/Bildirim.php <?php namespace AppNotifications; use AppModelsUye; use IlluminateBusQueueable; use IlluminateContractsQueueShouldQueue; use IlluminateNotificationsMessagesMailMessage; use IlluminateNotificationsNotification; class Bildirim extends Notification implements ShouldQueue { use Queueable; } my trait: <?php namespace ..

Read more

I created a laravel notification class with php artisan make:notification NewUserNotification class NewUserNotification extends Notification { use Queueable; protected $cost; private $order_id; /** * Create a new notification instance. * * @return void */ public function __construct($cost, $order_id) { $this->cost = $cost; $this->order_id = $order_id; } /** * Get the notification’s delivery channels. * * ..

Read more

$getdata = $this->patientVital->getNotificationResult(); if (!empty($getdata)) { if (!empty($getdata[‘daily’])) { foreach ($getdata[‘daily’] as $value) { foreach ($value[‘reminder_time’] as $reminder_time) { $time = strtotime(preg_replace(‘/s+/’, ”, $reminder_time[‘time’])); if ($time == strtotime($current_time) && $reminder_time[‘is_reminder_selected’] == ‘true’) { $this->fireFCMNotification($getdata); } } } Sourc..

Read more

I’m new to Firebase cloud messaging with Laravel, Thanks to this code https://www.itsolutionstuff.com/post/laravel-firebase-push-notification-tutorialexample.html I was able to send notifications from my Firebase to my Android device by token using curl. But, Is there any API or way to send a notification to all devices? Sourc..

Read more

I want tp apply queue for my Notifications, so I implemented that at my Notification which ResetPassword: class ResetPassword extends Notification implements ShouldQueue Then I ran php artisan queue:table and migrate it so the table jobs created successfully at the DB. And also change the QUEUE_CONNECTION to database at .env file and re-run php artisan ..

Read more