@kirk.franklin your config looks good. Can you try clearing your config?
LdapRecord: Connection doesn't exist error after successful test
When I run php artisan:test the default connection is successful, but when I run php artisan I get an error saying the connection doesn't exist.
config/ldap.php settings:
'default' => env('LDAP_CONNECTION', 'default'),
'connections' => [
'default' => [
'hosts' => [env('LDAP_HOST', '127.0.0.1')],
'username' => env('LDAP_USERNAME', 'cn=user,dc=local,dc=com'),
'password' => env('LDAP_PASSWORD', 'secret'),
'port' => env('LDAP_PORT', 389),
'base_dn' => env('LDAP_BASE_DN', 'dc=local,dc=com'),
'timeout' => env('LDAP_TIMEOUT', 5),
'use_ssl' => env('LDAP_SSL', false),
'use_tls' => env('LDAP_TLS', false),
],
],
.env settings (username and password copied from working environment)
LDAP_LOGGING=true
LDAP_CONNECTION=default
LDAP_CONNECTIONS=default
LDAP_DEFAULT_HOSTS=******.***.domain
LDAP_DEFAULT_USERNAME=COA\*********
LDAP_DEFAULT_PASSWORD=wEN2%By9lO2i29Vy%Qrg6NUZ5airjBOf$Oz
LDAP_DEFAULT_PORT=389
LDAP_DEFAULT_BASE_DN="dc=***,dc=domain"
LDAP_DEFAULT_TIMEOUT=5
LDAP_DEFAULT_SSL=false
LDAP_DEFAULT_TLS=false
Laravel 9.19 PHP 8.1 directorytree/ldaprecord-laravel 2.5.6
Configuration docs: https://ldaprecord.com/docs/laravel/v2/configuration#using-an-environment-file-env
I uninstalled and reinstalled LdapRecord with the same result.
@Kirk.Franklin Damn, kinda strange they say the config file and the .env file are mutually exclusive. The way I see it, the .env is mostly to complement config files in your laravel project
We have ldaprecord 2.5.6 on a Laravel 8 project and we haven't had any issues and we are using both files.
In the ldap.php everything is hardcoded except LDAP_USERNAME and LDAP_PASSWORD both which we are setting in our .env
Like I said, we have no issues using both files but maybe that's where "may lead to unexpected results" comes in. I guess we fell on the good side of the unexpected.
Please or to participate in this conversation.