PHP code example of directorytree / ldaprecord-browser

1. Go to this page and download the library: Download directorytree/ldaprecord-browser 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/ */

    

directorytree / ldaprecord-browser example snippets


// routes/web.php

Route::prefix('/ldap')->group(function () {
    \LdapRecord\Browser\Browser::routes();
});

use LdapRecord\Browser\Browser;
use LdapRecord\Browser\ModelType;

public function boot()
{
    Browser::models([
        ModelType::USER => \LdapRecord\Models\OpenLDAP\User::class,
        ModelType::GROUP => \LdapRecord\Models\OpenLDAP\Group::class,
        ModelType::DEFAULT => \LdapRecord\Models\OpenLDAP\Entry::class,
        ModelType::UNKNOWN => \LdapRecord\Models\OpenLDAP\Entry::class,
        ModelType::COMPUTER => \LdapRecord\Models\OpenLDAP\Entry::class,
        ModelType::CONTAINER => \LdapRecord\Models\OpenLDAP\OrganizationalUnit::class,
    ]);
}