validate($request, $this->rules()); broadcast(new Users($user, $request->input('type'), $request->all())); return $this->created("message sent."); } private function rules(): array { return [ 'message' => 'required|string|max:255', 'type' => 'required|in:info,error,warning,success', 'data' => 'nullable|json', ]; } // public function broadcast_to_host(Request $request, Host $host): JsonResponse // { // $this->validate($request, $this->rules()); // // broadcast(new Users($host->user, 'modules.hosts.event', [ // 'host' => $host, // 'message' => $request->input('message') // ])); // // return $this->created($request->input('message')); // } }