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 77
88class User extends Eloquent implements UserInterface, RemindableInterface {
99
10- protected $ collection = 'users ' ;
10+ protected $ collection = 'users ' ;
1111
12- protected $ dates = array ( ' birthday ' ) ;
12+ protected static $ unguarded = true ;
1313
14- protected static $ unguarded = true ;
15-
16- public function books ()
14+ public function books ()
1715 {
1816 return $ this ->hasMany ('Book ' , 'author_id ' );
1917 }
@@ -27,6 +25,11 @@ public function role()
2725 {
2826 return $ this ->hasOne ('Role ' );
2927 }
28+
29+ public function clients ()
30+ {
31+ return $ this ->belongsToMany ('Client ' );
32+ }
3033
3134 /**
3235 * Get the unique identifier for the user.
@@ -58,4 +61,4 @@ public function getReminderEmail()
5861 return $ this ->email ;
5962 }
6063
61- }
64+ }
You can’t perform that action at this time.
0 commit comments