Thanks for the answer, @bobbybouwmann!
But I can't make it work. The app.php has:
/*
|--------------------------------------------------------------------------
| Load The Application Routes
|--------------------------------------------------------------------------
|
| Next we will include the routes file so that they can all be added to
| the application. This will provide all of the URLs the application
| can respond to, as well as the controllers that may handle them.
|
*/
$app->router->group([
'namespace' => 'App\Http\Controllers',
], function ($router) {
require __DIR__.'/../routes/web.php';
});
return $app;
If I put a new route inside it it returns class now found errors.
This doesn't work too:
$app->router->group([
'namespace' => 'App\Http\Controllers',
], function ($router) {
require __DIR__.'/../routes/web.php';
});
$app->router->group(['middleware' => ['web']], function ($router) {
$router->post('/broadcasting/auth', Illuminate\Broadcasting\BroadcastController::class . '@authenticate');
});
return $app;
Log:
ReflectionException: Class web does not exist in /home/vagrant/Code/project/vendor/illuminate/container/Container.php:752
I also tried to put
$router->post('/broadcasting/auth', Illuminate\Broadcasting\BroadcastController::class . '@authenticate');
into my routes/web.php, but without success.