@@ -106,6 +106,12 @@ to the users as you would a regular laravel application.
106106
107107### Installation
108108
109+ [ Laravel 5.1 & Lower] ( #laravel-5-1 )
110+
111+ [ Laravel 5.2] ( #laravel-5-2 )
112+
113+ #### Laravel 5.1 & Lower
114+
109115Insert the ` AdldapAuthServiceProvider ` into your ` config/app.php ` file:
110116
111117``` php
@@ -137,6 +143,90 @@ Change the auth driver in `config/auth.php` to `adldap`:
137143'driver' => 'adldap',
138144```
139145
146+ #### Laravel 5.2
147+
148+ Insert the ` AdldapAuthServiceProvider ` into your ` config/app.php ` file:
149+
150+ ``` php
151+ Adldap\Laravel\AdldapAuthServiceProvider::class,
152+ ```
153+
154+ Publish the auth configuration:
155+
156+ ``` bash
157+ php artisan vendor:publish --tag=" adldap"
158+ ```
159+
160+ Open your ` config/auth.php ` configuration file and change the following:
161+
162+ Change the ` provider ` entry inside the ` web ` authentication guard:
163+
164+ ``` php
165+
166+ /*
167+ |--------------------------------------------------------------------------
168+ | Authentication Guards
169+ |--------------------------------------------------------------------------
170+ |
171+ | Next, you may define every authentication guard for your application.
172+ | Of course, a great default configuration has been defined for you
173+ | here which uses session storage and the Eloquent user provider.
174+ |
175+ | All authentication drivers have a user provider. This defines how the
176+ | users are actually retrieved out of your database or other storage
177+ | mechanisms used by this application to persist your user's data.
178+ |
179+ | Supported: "session", "token"
180+ |
181+ */
182+
183+ 'guards' => [
184+ 'web' => [
185+ 'driver' => 'session',
186+ 'provider' => 'adldap',
187+ ],
188+ 'api' => [
189+ 'driver' => 'token',
190+ 'provider' => 'users',
191+ ],
192+ ],
193+ ```
194+
195+ Now add the ` adldap ` provider to your ` providers ` array:
196+
197+ ``` php
198+ /*
199+ |--------------------------------------------------------------------------
200+ | User Providers
201+ |--------------------------------------------------------------------------
202+ |
203+ | All authentication drivers have a user provider. This defines how the
204+ | users are actually retrieved out of your database or other storage
205+ | mechanisms used by this application to persist your user's data.
206+ |
207+ | If you have multiple user tables or models you may configure multiple
208+ | sources which represent each model / table. These sources may then
209+ | be assigned to any extra authentication guards you have defined.
210+ |
211+ | Supported: "database", "eloquent"
212+ |
213+ */
214+ 'providers' => [
215+ 'adldap' => [
216+ 'driver' => 'adldap',
217+ 'model' => App\User::class,
218+ ],
219+ 'users' => [
220+ 'driver' => 'eloquent',
221+ 'model' => App\User::class,
222+ ],
223+ // 'users' => [
224+ // 'driver' => 'database',
225+ // 'table' => 'users',
226+ // ],
227+ ],
228+ ```
229+
140230### Usage
141231
142232#### Username Attributes
0 commit comments