改进 模块广播

This commit is contained in:
iVampireSP.com 2023-01-11 00:35:32 +08:00
parent 98447233d0
commit c0b0c54004
No known key found for this signature in database
GPG Key ID: 2F7B001CA27A8132

View File

@ -17,7 +17,7 @@ public function broadcast_to_user(Request $request, User $user): JsonResponse
broadcast(new Users($user, $request->filled('type'), $request->all())); broadcast(new Users($user, $request->filled('type'), $request->all()));
return $this->created($request); return $this->created("message sent.");
} }
private function rules(): array private function rules(): array
@ -25,7 +25,7 @@ private function rules(): array
return [ return [
'message' => 'required|string|max:255', 'message' => 'required|string|max:255',
'type' => 'required|in:info,error,warning,success', 'type' => 'required|in:info,error,warning,success',
'data' => 'nullable|array', 'data' => 'nullable|json',
]; ];
} }