Skip to content

Catching successful and unsuccessful LDAP searches #587

Answered by stevebauman
acharseth asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @acharseth,

Those events you're attempting to watch on are from the native core LdapRecord framework, which requires you to register your listeners from it's event dispatcher and not Laravel's event dispatcher. This is because the core LdapRecord framework doesn't require the use of Laravel (or any framework for that matter).

Here are docs on how to register listeners for core LdapRecord events:

https://ldaprecord.com/docs/core/v3/events/#registering-listeners

use LdapRecord\Container;
use \LdapRecord\Query\Events\Search;

$dispatcher = Container::getDispatcher();

$dispatcher->listen(Search::class, function (Search $event) {
    // ...
});

To tell which events can be listened for in L…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@stevebauman
Comment options

Answer selected by acharseth
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants