|
vor 2 Jahren | |
---|---|---|
.. | ||
auth | vor 2 Jahren | |
tutorials | vor 2 Jahren | |
.nojekyll | vor 2 Jahren | |
_sidebar.md | vor 2 Jahren | |
auth.md | vor 2 Jahren | |
index.html | vor 2 Jahren | |
installation.md | vor 2 Jahren | |
readme.md | vor 2 Jahren | |
setup.md | vor 2 Jahren | |
upgrading.md | vor 2 Jahren | |
usage.md | vor 2 Jahren |
Adldap2-Laravel is an extension to the core Adldap2 package.
This package allows you to:
Install Adldap2-Laravel via composer using the command:
composer require adldap2/adldap2-laravel
Publish the configuration file using:
php artisan vendor:publish --provider="Adldap\Laravel\AdldapServiceProvider"
Configure your LDAP connection in the published ldap.php
file.
Then, use the Adldap\Laravel\Facades\Adldap
facade:
use Adldap\Laravel\Facades\Adldap;
// Finding a user:
$user = Adldap::search()->users()->find('john doe');
// Searching for a user:
$search = Adldap::search()->where('cn', '=', 'John Doe')->get();
// Running an operation under a different connection:
$users = Adldap::getProvider('other-connection')->search()->users()->get();
// Creating a user:
$user = Adldap::make()->user([
'cn' => 'John Doe',
]);
// Modifying Attributes:
$user->cn = 'Jane Doe';
// Saving a user:
$user->save();
Or inject the Adldap\AdldapInterface
:
use Adldap\AdldapInterface;
class UserController extends Controller
{
/**
* @var Adldap
*/
protected $ldap;
/**
* Constructor.
*
* @param AdldapInterface $adldap
*/
public function __construct(AdldapInterface $ldap)
{
$this->ldap = $ldap;
}
/**
* Displays the all LDAP users.
*
* @return \Illuminate\View\View
*/
public function index()
{
$users = $this->ldap->search()->users()->get();
return view('users.index', compact('users'));
}
/**
* Displays the specified LDAP user.
*
* @return \Illuminate\View\View
*/
public function show($id)
{
$user = $this->ldap->search()->findByGuid($id);
return view('users.show', compact('user'));
}
}
Adldap2-Laravel is versioned under the Semantic Versioning guidelines as much as possible.
Releases will be numbered with the following format:
<major>.<minor>.<patch>
And constructed with the following guidelines:
Minor versions are not maintained individually, and you're encouraged to upgrade through to the next minor version.
Major versions are maintained individually through separate branches.