user() !== null; } public function rules(): array { return [ 'type' => 'required|in:direct,group', 'recipient_id' => 'required_if:type,direct|integer|exists:users,id', 'participant_ids' => 'required_if:type,group|array|min:2', 'participant_ids.*' => 'integer|exists:users,id', 'title' => 'required_if:type,group|nullable|string|max:120', 'body' => 'required|string|max:5000', 'client_temp_id' => 'nullable|string|max:120', ]; } }