Skip to content
This repository was archived by the owner on Jul 24, 2023. It is now read-only.

Commit b55a253

Browse files
committed
Added Adldap contract example
1 parent 07a0dcb commit b55a253

File tree

1 file changed

+33
-1
lines changed

1 file changed

+33
-1
lines changed

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,40 @@ You can perform all methods on Adldap through its facade like so:
4242
// Passed!
4343
}
4444

45-
To see more usage in detail, please visit the [Adldap2 Repository](http://github.com/Adldap2/Adldap2);
45+
Or you can inject the Adldap contract:
4646

47+
use Adldap\Contracts\Adldap;
48+
49+
class UserController extends Controller
50+
{
51+
/**
52+
* @var Adldap
53+
*/
54+
protected $adldap;
55+
56+
/**
57+
* Constructor.
58+
*
59+
* @param Adldap $adldap
60+
*/
61+
public function __construct(Adldap $adldap)
62+
{
63+
$this->adldap = $adldap;
64+
}
65+
/**
66+
* Displays the all LDAP users.
67+
*
68+
* @return \Illuminate\View\View
69+
*/
70+
public function index()
71+
{
72+
$users = $this->adldap->users()->all();
73+
74+
return view('users.index', compact('users'));
75+
}
76+
}
77+
78+
To see more usage in detail, please visit the [Adldap2 Repository](http://github.com/Adldap2/Adldap2);
4779

4880
## Auth Driver
4981

0 commit comments

Comments
 (0)