File tree Expand file tree Collapse file tree 6 files changed +63
-0
lines changed Expand file tree Collapse file tree 6 files changed +63
-0
lines changed Original file line number Diff line number Diff line change 3030
3131 'public_key ' => env ('PASSPORT_PUBLIC_KEY ' ),
3232
33+ /*
34+ |--------------------------------------------------------------------------
35+ | Passport Database Connection
36+ |--------------------------------------------------------------------------
37+ |
38+ | By default, Passport's models will utilize your application's default
39+ | database connection. If you wish to use a different connection you
40+ | may specify the configured name of the database connection here.
41+ |
42+ */
43+
44+ 'connection ' => env ('PASSPORT_CONNECTION ' ),
45+
3346 /*
3447 |--------------------------------------------------------------------------
3548 | Client UUIDs
Original file line number Diff line number Diff line change @@ -60,4 +60,14 @@ public function client()
6060 {
6161 return $ this ->belongsTo (Passport::clientModel ());
6262 }
63+
64+ /**
65+ * Get the current connection name for the model.
66+ *
67+ * @return string|null
68+ */
69+ public function getConnectionName ()
70+ {
71+ return $ this ->connection ?? config ('passport.connection ' );
72+ }
6373}
Original file line number Diff line number Diff line change @@ -228,6 +228,16 @@ public function getIncrementing()
228228 return Passport::clientUuids () ? false : $ this ->incrementing ;
229229 }
230230
231+ /**
232+ * Get the current connection name for the model.
233+ *
234+ * @return string|null
235+ */
236+ public function getConnectionName ()
237+ {
238+ return $ this ->connection ?? config ('passport.connection ' );
239+ }
240+
231241 /**
232242 * Create a new factory instance for the model.
233243 *
Original file line number Diff line number Diff line change @@ -29,4 +29,14 @@ public function client()
2929 {
3030 return $ this ->belongsTo (Passport::clientModel ());
3131 }
32+
33+ /**
34+ * Get the current connection name for the model.
35+ *
36+ * @return string|null
37+ */
38+ public function getConnectionName ()
39+ {
40+ return $ this ->connection ?? config ('passport.connection ' );
41+ }
3242}
Original file line number Diff line number Diff line change @@ -80,4 +80,14 @@ public function transient()
8080 {
8181 return false ;
8282 }
83+
84+ /**
85+ * Get the current connection name for the model.
86+ *
87+ * @return string|null
88+ */
89+ public function getConnectionName ()
90+ {
91+ return $ this ->connection ?? config ('passport.connection ' );
92+ }
8393}
Original file line number Diff line number Diff line change @@ -126,4 +126,14 @@ public function transient()
126126 {
127127 return false ;
128128 }
129+
130+ /**
131+ * Get the current connection name for the model.
132+ *
133+ * @return string|null
134+ */
135+ public function getConnectionName ()
136+ {
137+ return $ this ->connection ?? config ('passport.connection ' );
138+ }
129139}
You can’t perform that action at this time.
0 commit comments