antonioribeiro / health

Laravel Health Panel
BSD 3-Clause "New" or "Revised" License
1.95k stars 197 forks source link

Broadcast check failing #144

Open salhdev opened 5 years ago

salhdev commented 5 years ago

Hello, I have tested this package with a fresh new installation of laravel 5.7 to make sure there was no interference from any other package. I also used the "dev-master" version to see if the problem had been resolved. The javascript gets a 404 not found when it sends the pong message, I listed all routes and could not find the callback route ! I have no idea why the callback route is not being registered :( This is what the js script outputs :

Started Server ... Message pragmarx-health-broadcasting-channel Received ... ponging... pong To Url : http://homestead.test/health/broadcasting/callback/6d3y1UH8Xv3L5Lyi7UnW6JQkRRwyB6Pv error: null statusCode: 404

and this is the route:list : vagrant@homestead:~/code/laravel-5-boilerplate$ php artisan route:list | grep health

| | GET|HEAD | health/assets/css/app.css | pragmarx.health.assets.css | PragmaRX\Health\Http\Controllers\Health@assetAppCss | web | | | GET|HEAD | health/assets/js/app.js | pragmarx.health.assets.js | PragmaRX\Health\Http\Controllers\Health@assetAppJs | web | | | GET|HEAD | health/check | pragmarx.health.check | PragmaRX\Health\Http\Controllers\Health@check | web | | | GET|HEAD | health/config | pragmarx.health.config | PragmaRX\Health\Http\Controllers\Health@config | web | | | GET|HEAD | health/panel | pragmarx.health.panel | PragmaRX\Health\Http\Controllers\Health@panel | web | | | GET|HEAD | health/resources | pragmarx.health.resources.all | PragmaRX\Health\Http\Controllers\Health@allResources | web | | | GET|HEAD | health/resources/{slug} | pragmarx.health.resources.get | PragmaRX\Health\Http\Controllers\Health@getResource | web | | | GET|HEAD | health/string | pragmarx.health.string | PragmaRX\Health\Http\Controllers\Health@string

Thanks for looking into it ! Salh

OlexandrPopov commented 3 years ago

I was able to setup the callback endpoint by adding the following route config:

[
    'uri' => "{$route_prefix}/broadcasting/callback/{secret}",
    'name' => 'pragmarx.health.broadcasting.callback',
    'action' => "PragmaRX\Health\Http\Controllers\Broadcasting@callback",
    'middleware' => [
        'web',
        'admin',
    ],
],

However, the Broadcasting test doesn't seem to be working at all.