File tree Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Expand file tree Collapse file tree 2 files changed +23
-6
lines changed Original file line number Diff line number Diff line change
1
+ <?php
2
+ use Jenssegers \Mongodb \Model as Eloquent ;
3
+
4
+ class Client extends Eloquent {
5
+
6
+ protected $ collection = 'clients ' ;
7
+
8
+ protected static $ unguarded = true ;
9
+
10
+ public function users ()
11
+ {
12
+ return $ this ->belongsToMany ('User ' );
13
+ }
14
+ }
Original file line number Diff line number Diff line change 7
7
8
8
class User extends Eloquent implements UserInterface, RemindableInterface {
9
9
10
- protected $ collection = 'users ' ;
10
+ protected $ collection = 'users ' ;
11
11
12
- protected $ dates = array ( ' birthday ' ) ;
12
+ protected static $ unguarded = true ;
13
13
14
- protected static $ unguarded = true ;
15
-
16
- public function books ()
14
+ public function books ()
17
15
{
18
16
return $ this ->hasMany ('Book ' , 'author_id ' );
19
17
}
@@ -27,6 +25,11 @@ public function role()
27
25
{
28
26
return $ this ->hasOne ('Role ' );
29
27
}
28
+
29
+ public function clients ()
30
+ {
31
+ return $ this ->belongsToMany ('Client ' );
32
+ }
30
33
31
34
/**
32
35
* Get the unique identifier for the user.
@@ -58,4 +61,4 @@ public function getReminderEmail()
58
61
return $ this ->email ;
59
62
}
60
63
61
- }
64
+ }
You can’t perform that action at this time.
0 commit comments