Is there any function to check the ldap connection inside blade templates? #323
Answered
by
stevebauman
luis-gmonkey
asked this question in
Q&A
-
Hello guys, is there any built in method to check the ldap connection without writing all the parameters required? Kinda like My goal is to check if the ldap server is online, and display that data. |
Beta Was this translation helpful? Give feedback.
Answered by
stevebauman
Jul 14, 2021
Replies: 2 comments 1 reply
-
I guess I can do it with |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey @luis-gmonkey, yes this is definitely possible, you just need to resolve the LDAP connection and attempt connecting: use LdapRecord\Container;
use LdapRecord\LdapRecordException;
$connected = rescue(function () {
$connection = Container::getDefaultConnection();
$connection->connect();
return true;
}, $default = false); Does this answer your question? |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
luis-gmonkey
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @luis-gmonkey, yes this is definitely possible, you just need to resolve the LDAP connection and attempt connecting:
Does this answer your question?