PHP code example of ohffs / simple-laravel-ldap

1. Go to this page and download the library: Download ohffs/simple-laravel-ldap library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ohffs / simple-laravel-ldap example snippets


php artisan vendor:publish

use Ohffs\Ldap\LdapService;

public function __construct(LdapService $ldap)
{
    $this->ldap = $ldap;
}

public function something()
{
   if ($this->ldap->authenticate('username', 'password')) {
       // ...
   }
}