group(function () { Route::get('/', ['as' => 'writeMessage', 'uses' => 'SocketController@writeMessage']); Route::get('avatar/{user_id}', 'ImageController@getAvatar'); Route::get('profile', 'UserController@Profile'); Route::post('avatar', 'UserController@updateAvatar'); Route::post('sendMessage', 'SocketController@sendMessage'); });