*/
public function broadcastOn()
{
- return new PrivateChannel('Tournament.'.$this->result->round->tournament_id);
+ return new Channel('Tournament.'.$this->result->round->tournament_id);
}
public $result;
*/
public function broadcastOn()
{
- return new PrivateChannel('Tournament.'.$this->round->tournament_id);
+ return new Channel('Tournament.'.$this->round->tournament_id);
}
public $round;
*/
public function broadcastOn()
{
- return new PrivateChannel('Tournament.'.$this->round->tournament_id);
+ return new Channel('Tournament.'.$this->round->tournament_id);
}
public $round;
* @param \App\Models\User $user
* @return \Illuminate\Auth\Access\Response|bool
*/
- public function viewAny(User $user)
+ public function viewAny(?User $user)
{
return true;
}
* @param \App\Models\Tournament $tournament
* @return \Illuminate\Auth\Access\Response|bool
*/
- public function view(User $user, Tournament $tournament)
+ public function view(?User $user, Tournament $tournament)
{
return true;
}
import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom';
import Header from './common/Header';
-import Front from './pages/Front';
import Tournament from './pages/Tournament';
import UserContext from '../helpers/UserContext';
return <BrowserRouter>
<UserContext.Provider value={user}>
<Header doLogout={doLogout} />
- {user ?
- <Routes>
- <Route path="tournaments/:id" element={<Tournament />} />
- <Route path="*" element={<Navigate to="/tournaments/1" />} />
- </Routes>
- : <Front />}
+ <Routes>
+ <Route path="tournaments/:id" element={<Tournament />} />
+ <Route path="*" element={<Navigate to="/tournaments/1" />} />
+ </Routes>
</UserContext.Provider>
</BrowserRouter>;
};
}, [id]);
useEffect(() => {
- window.Echo.private(`Tournament.${id}`)
+ window.Echo.channel(`Tournament.${id}`)
.listen('ResultReported', e => {
if (e.result) {
setTournament(tournament => patchResult(tournament, e.result));
useEffect(() => {
window.Echo.private(`Protocol.${id}`)
.listen('ProtocolAdded', e => {
- console.log(e);
if (e.protocol) {
setProtocol(protocol => [e.protocol, ...protocol]);
}