Skip to content

Commit

Permalink
fix: Realtime notification issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dogukanoksuz committed Nov 18, 2024
1 parent 398dc81 commit 83874d9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app/Classes/NotificationBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ public function convertToBroadcastable(): array
break;
}

Carbon::setLocale($this->locale ?: env('APP_LOCALE', 'tr'));

$object = [
'notification_id' => $this->notification->id,
'title' => $title,
Expand Down
4 changes: 3 additions & 1 deletion routes/channels.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
|
*/

Broadcast::channel('App.User.{id}', function ($user, $id) {
use Illuminate\Support\Facades\Broadcast;

Broadcast::channel('App.Models.User.{id}', function ($user, $id) {
return (int) $user->id === (int) $id;
});

0 comments on commit 83874d9

Please sign in to comment.