DirectoryTree / LdapRecord-Laravel

Multi-domain LDAP Authentication & Management for Laravel.
https://ldaprecord.com/docs/laravel/v3
MIT License
492 stars 51 forks source link

Fixing LdapRecord Connection Error in Laravel #526

Closed gabbriell closed 1 year ago

gabbriell commented 1 year ago

Good evening. After following the steps in the documentation to configure LDAP in Laravel - installation, configuration, and usage - when using the command "php artisan ldap:test", the following error message is displayed: Error

Call to undefined method LdapRecord\ConnectionManager::all()

at C:\xampp\htdocs\autenticacao\vendor\directorytree\ldaprecord\src\Container.php:63 59▕ Forward missing method calls onto the connection manager. 60▕ / 61▕ public function __call(string $method, array $parameters): mixed 62▕ { ➜ 63▕ return $this->getConnectionManager()->{$method}(...$parameters); 64▕ } 65▕ 66▕ / 67▕ * Get the connection manager.

1 C:\xampp\htdocs\autenticacao\vendor\directorytree\ldaprecord-laravel\src\Commands\TestLdapConnection.php:39 LdapRecord\Container::__call("all", [])

2 C:\xampp\htdocs\autenticacao\vendor\laravel\framework\src\Illuminate\Container\BoundMethod.php:36 LdapRecord\Laravel\Commands\TestLdapConnection::handle()

stevebauman commented 1 year ago

Hi @gabbriell,

I'm not able to reproduce this on a fresh Laravel install with the latest LdapRecord-Laravel install.

A test against this command is also passing in the repository:

https://github.com/DirectoryTree/LdapRecord-Laravel/blob/master/tests/Feature/Commands/TestLdapConnectionTest.php

I'd try deleting the vendor directory and attempt re-installing LdapRecord-Laravel via the below command:

composer require directorytree/ldaprecord-laravel

If you still receive the issue, please send a link to a GitHub repository where you're able to reproduce this issue, thanks!