Broadcast Pusher Notifications
Hi,
I need to implement pusher notification on filament, and I have this:
config/app.php
`
config/filament.php
`
BroadcastServicProvider.php
`
.env
`
My send notification:
`
And I have this error on chrome console:
Request URL: http://site.local/api/v1/broadcasting/auth 404 Not Found
What is missing?
I need to implement pusher notification on filament, and I have this:
config/app.php
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\BroadcastServiceProvider::class,App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
App\Providers\BroadcastServiceProvider::class,config/filament.php
'broadcasting' => [
'echo' => [
'broadcaster' => 'pusher',
'key' => env('VITE_PUSHER_APP_KEY'),
'cluster' => env('VITE_PUSHER_APP_CLUSTER'),
'wsHost' => env('VITE_PUSHER_HOST'),
'wsPort' => env('VITE_PUSHER_PORT'),
'wssPort' => env('VITE_PUSHER_PORT'),
'authEndpoint' => '/api/v1/broadcasting/auth',
'disableStats' => true,
'encrypted' => true,
],
],'broadcasting' => [
'echo' => [
'broadcaster' => 'pusher',
'key' => env('VITE_PUSHER_APP_KEY'),
'cluster' => env('VITE_PUSHER_APP_CLUSTER'),
'wsHost' => env('VITE_PUSHER_HOST'),
'wsPort' => env('VITE_PUSHER_PORT'),
'wssPort' => env('VITE_PUSHER_PORT'),
'authEndpoint' => '/api/v1/broadcasting/auth',
'disableStats' => true,
'encrypted' => true,
],
],BroadcastServicProvider.php
class BroadcastServiceProvider extends ServiceProvider
{
public function boot(): void
{
Broadcast::routes(['middleware' => ['auth:api']]);
require base_path('routes/channels.php');
}
}class BroadcastServiceProvider extends ServiceProvider
{
public function boot(): void
{
Broadcast::routes(['middleware' => ['auth:api']]);
require base_path('routes/channels.php');
}
}.env
`
PUSHER_APP_ID=yyyy
PUSHER_APP_KEY=xxxx
PUSHER_APP_SECRET=wwwww
PUSHER_HOST="${APP_URL}"
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=eu
VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"`
PUSHER_APP_ID=yyyy
PUSHER_APP_KEY=xxxx
PUSHER_APP_SECRET=wwwww
PUSHER_HOST="${APP_URL}"
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=eu
VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"My send notification:
class NotificationService
{
private User $user;
public function __construct(User $user)
{
$this->user = $user;
}
public function sendToBroadcast(string $title): Notification
{
return Notification::make()
->title($title)
->broadcast($this->user);
}
}class NotificationService
{
private User $user;
public function __construct(User $user)
{
$this->user = $user;
}
public function sendToBroadcast(string $title): Notification
{
return Notification::make()
->title($title)
->broadcast($this->user);
}
}And I have this error on chrome console:
Request URL: http://site.local/api/v1/broadcasting/auth 404 Not Found
What is missing?