findWhere(['user_id' => $userId]); } /** * Get the first enabled extension for a user that matches a specific protocol. * * @param int $userId * @param string $protocol 'sip' | 'pjsip' | 'wss' * @return \Modules\Platform\User\Entities\UserExtension|null */ public function getEnabledByProtocol(int $userId, string $protocol) { return UserExtension::where('user_id', $userId) ->where('sip_protocol', $protocol) ->where('sip_credentials_enabled', true) ->first(); } }