File tree 4 files changed +59
-11
lines changed
4 files changed +59
-11
lines changed Original file line number Diff line number Diff line change 16
16
"illuminate/events" : " 4.0.x"
17
17
},
18
18
"require-dev" : {
19
- "illuminate/cache" : " 4.0.x"
19
+ "illuminate/cache" : " 4.0.x" ,
20
+ "illuminate/auth" : " 4.0.x"
20
21
},
21
22
"autoload" : {
22
23
"psr-0" : {
Original file line number Diff line number Diff line change @@ -25,15 +25,12 @@ function bound() {}
25
25
# Cache driver
26
26
$ app ['cache ' ] = new Repository (new ArrayStore );
27
27
28
- # Database configuration
29
- $ app ['config ' ]['database.fetch ' ] = null ;
30
- $ app ['config ' ]['database.default ' ] = 'mongodb ' ;
31
- $ app ['config ' ]['database.connections ' ]['mongodb ' ] = array (
32
- 'name ' => 'mongodb ' ,
33
- 'driver ' => 'mongodb ' ,
34
- 'host ' => 'localhost ' ,
35
- 'database ' => 'unittest '
36
- );
28
+ # Load database configuration
29
+ $ config = require 'config/database.php ' ;
30
+ foreach ($ config as $ key => $ value )
31
+ {
32
+ $ app ['config ' ]["database. $ key " ] = $ value ;
33
+ }
37
34
38
35
# Initialize database manager
39
36
$ app ['db.factory ' ] = new ConnectionFactory (new Container );
Original file line number Diff line number Diff line change
1
+ <?php
2
+
3
+ return array (
4
+
5
+ 'fetch ' => PDO ::FETCH_CLASS ,
6
+ 'default ' => 'mongodb ' ,
7
+
8
+ 'connections ' => array (
9
+ 'mongodb ' => array (
10
+ 'name ' => 'mongodb ' ,
11
+ 'driver ' => 'mongodb ' ,
12
+ 'host ' => 'localhost ' ,
13
+ 'database ' => 'unittest ' ,
14
+ ),
15
+ )
16
+
17
+ );
Original file line number Diff line number Diff line change 2
2
3
3
use Jenssegers \Mongodb \Model as Eloquent ;
4
4
5
- class User extends Eloquent {
5
+ use Illuminate \Auth \UserInterface ;
6
+ use Illuminate \Auth \Reminders \RemindableInterface ;
7
+
8
+ class User extends Eloquent implements UserInterface, RemindableInterface {
6
9
7
10
protected $ collection = 'users ' ;
8
11
@@ -23,4 +26,34 @@ public function role()
23
26
return $ this ->hasOne ('Role ' );
24
27
}
25
28
29
+ /**
30
+ * Get the unique identifier for the user.
31
+ *
32
+ * @return mixed
33
+ */
34
+ public function getAuthIdentifier ()
35
+ {
36
+ return $ this ->getKey ();
37
+ }
38
+
39
+ /**
40
+ * Get the password for the user.
41
+ *
42
+ * @return string
43
+ */
44
+ public function getAuthPassword ()
45
+ {
46
+ return $ this ->password ;
47
+ }
48
+
49
+ /**
50
+ * Get the e-mail address where password reminders are sent.
51
+ *
52
+ * @return string
53
+ */
54
+ public function getReminderEmail ()
55
+ {
56
+ return $ this ->email ;
57
+ }
58
+
26
59
}
You can’t perform that action at this time.
0 commit comments