You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 24, 2023. It is now read-only.
2. Open up your `composer.json` file and insert the following in the `require: {}` array:
18
-
-`"adldap2/adldap2-laravel": "3.0.*"`
15
+
2. Run the following command to install Adldap2-Laravel:
19
16
20
-
3. Run the`composer update` command in the root directory of your project to pull in Adldap2 and its dependencies.
17
+
-`composer require adldap2-laravel`
21
18
22
-
4. Create a new database in your desired database interface (such as PhpMyAdmin, MySQL Workbench, command line etc.)
19
+
3. Create a new database in your desired database interface (such as PhpMyAdmin, MySQL Workbench, command line etc.)
23
20
24
-
5. Enter your database details and credentials inside the `.env` file located in your project root directory (if there is not one there, rename the `.env.example` to `.env`).
21
+
4. Enter your database details and credentials inside the `.env` file located in your project root directory (if there is not one there, rename the `.env.example` to `.env`).
25
22
26
-
6. If you're using username's to login users **instead** of their emails, you will need to change
23
+
5. If you're using username's to login users **instead** of their emails, you will need to change
27
24
the default `email` column in `database/migrations/2014_10_12_000000_create_users_table.php`.
Schema::create('users', function (Blueprint $table) {
30
+
$table->increments('id');
31
+
$table->string('name');
32
+
33
+
// From:
34
+
$table->string('email')->unique();
35
+
36
+
// To:
37
+
$table->string('username')->unique();
38
+
39
+
$table->string('password');
40
+
$table->rememberToken();
41
+
$table->timestamps();
42
+
});
43
+
```
47
44
48
-
7. Now run `php artisan migrate`.
45
+
6. Now run `php artisan migrate`.
46
+
47
+
7. Insert the following service providers in your `config/app.php` file (in the `providers` array):
49
48
50
-
8. Insert the following service providers in your `config/app.php` file (in the `providers` array):
49
+
> **Note**: This step is only required for Laravel 5.0 - 5.4.
50
+
> They are registered automatically in Laravel 5.5.
51
51
52
52
```php
53
53
Adldap\Laravel\AdldapServiceProvider::class,
54
54
Adldap\Laravel\AdldapAuthServiceProvider::class,
55
55
```
56
56
57
-
9. Now, insert the facade into your `config/app.php` file (in the `aliases` array):
57
+
8. Now, insert the facade into your `config/app.php` file (in the `aliases` array):
58
58
59
59
```php
60
60
'Adldap' => Adldap\Laravel\Facades\Adldap::class,
61
61
```
62
62
63
63
> **Note**: Insertion of this alias in your `app.php` file isn't necessary unless you're planning on utilizing it.
64
64
65
-
10. Now run `php artisan vendor:publish` in your root project directory to publish Adldap2's configuration files.
65
+
9. Now run `php artisan vendor:publish` in your root project directory to publish Adldap2's configuration files.
66
66
67
67
* Two files will be published inside your `config` folder, `adldap.php` and `adldap_auth.php`.
68
68
69
-
11. Modify the `config/adldap.php` file for your AD server configuration.
69
+
10. Modify the `config/adldap.php` file for your AD server configuration.
70
70
71
-
12. Run the command `php artisan make:auth` to scaffold authentication controllers and routes.
71
+
11. Run the command `php artisan make:auth` to scaffold login controllers and routes.
72
72
73
-
13. If you require logging in by another attribute, such as a username instead of email follow
73
+
12. If you require logging in by another attribute, such as a username instead of email follow
74
74
the process below for your Laravel version. Otherwise ignore this step.
75
75
76
-
***Laravel <= 5.2**
76
+
**Laravel <= 5.2**
77
77
78
78
Inside the generated `app/Http/Controllers/Auth/AuthController.php`, you'll need to add the `protected $username` property if you're logging in users by username.
79
79
@@ -83,7 +83,7 @@ the process below for your Laravel version. Otherwise ignore this step.
83
83
protected $username = 'username';
84
84
```
85
85
86
-
***Laravel > 5.3**
86
+
**Laravel > 5.3**
87
87
88
88
Inside the generated `app/Http/Controllers/Auth/LoginController.php`, you'll need to add the public method `username()`:
89
89
@@ -94,7 +94,7 @@ the process below for your Laravel version. Otherwise ignore this step.
94
94
}
95
95
```
96
96
97
-
14. Now insert a new auth driver inside your `config/auth.php` file:
97
+
13. Now insert a new auth driver inside your `config/auth.php` file:
98
98
99
99
```php
100
100
'providers' => [
@@ -105,7 +105,7 @@ the process below for your Laravel version. Otherwise ignore this step.
105
105
],
106
106
```
107
107
108
-
15. Inside your `resources/views/auth/login.blade.php` file, if you're requiring the user logging in by username, you'll
108
+
14. Inside your `resources/views/auth/login.blade.php` file, if you're requiring the user logging in by username, you'll
109
109
need to modify the HTML input to `username` instead of `email`. Ignore this step otherwise.
110
110
111
111
From:
@@ -119,8 +119,8 @@ the process below for your Laravel version. Otherwise ignore this step.
0 commit comments