File tree 10 files changed +89
-89
lines changed
10 files changed +89
-89
lines changed Original file line number Diff line number Diff line change 51
51
| Passport Storage Driver
52
52
|--------------------------------------------------------------------------
53
53
|
54
- | This configuration options determines the storage driver that will
55
- | be used to store Passport's data. In addition, you may set any
56
- | custom options as needed by the particular driver you choose .
54
+ | This configuration value allows you to customize the storage options
55
+ | for Passport, such as the database connection that should be used
56
+ | by Passport's internal database models which store tokens, etc .
57
57
|
58
58
*/
59
59
Original file line number Diff line number Diff line change @@ -23,16 +23,6 @@ public function __construct()
23
23
$ this ->schema = Schema::connection ($ this ->getConnection ());
24
24
}
25
25
26
- /**
27
- * Get the migration connection name.
28
- *
29
- * @return string|null
30
- */
31
- public function getConnection ()
32
- {
33
- return config ('passport.storage.database.connection ' );
34
- }
35
-
36
26
/**
37
27
* Run the migrations.
38
28
*
@@ -59,4 +49,14 @@ public function down()
59
49
{
60
50
$ this ->schema ->dropIfExists ('oauth_auth_codes ' );
61
51
}
52
+
53
+ /**
54
+ * Get the migration connection name.
55
+ *
56
+ * @return string|null
57
+ */
58
+ public function getConnection ()
59
+ {
60
+ return config ('passport.storage.database.connection ' );
61
+ }
62
62
}
Original file line number Diff line number Diff line change @@ -23,16 +23,6 @@ public function __construct()
23
23
$ this ->schema = Schema::connection ($ this ->getConnection ());
24
24
}
25
25
26
- /**
27
- * Get the migration connection name.
28
- *
29
- * @return string|null
30
- */
31
- public function getConnection ()
32
- {
33
- return config ('passport.storage.database.connection ' );
34
- }
35
-
36
26
/**
37
27
* Run the migrations.
38
28
*
@@ -61,4 +51,14 @@ public function down()
61
51
{
62
52
$ this ->schema ->dropIfExists ('oauth_access_tokens ' );
63
53
}
54
+
55
+ /**
56
+ * Get the migration connection name.
57
+ *
58
+ * @return string|null
59
+ */
60
+ public function getConnection ()
61
+ {
62
+ return config ('passport.storage.database.connection ' );
63
+ }
64
64
}
Original file line number Diff line number Diff line change @@ -23,16 +23,6 @@ public function __construct()
23
23
$ this ->schema = Schema::connection ($ this ->getConnection ());
24
24
}
25
25
26
- /**
27
- * Get the migration connection name.
28
- *
29
- * @return string|null
30
- */
31
- public function getConnection ()
32
- {
33
- return config ('passport.storage.database.connection ' );
34
- }
35
-
36
26
/**
37
27
* Run the migrations.
38
28
*
@@ -57,4 +47,14 @@ public function down()
57
47
{
58
48
$ this ->schema ->dropIfExists ('oauth_refresh_tokens ' );
59
49
}
50
+
51
+ /**
52
+ * Get the migration connection name.
53
+ *
54
+ * @return string|null
55
+ */
56
+ public function getConnection ()
57
+ {
58
+ return config ('passport.storage.database.connection ' );
59
+ }
60
60
}
Original file line number Diff line number Diff line change @@ -23,16 +23,6 @@ public function __construct()
23
23
$ this ->schema = Schema::connection ($ this ->getConnection ());
24
24
}
25
25
26
- /**
27
- * Get the migration connection name.
28
- *
29
- * @return string|null
30
- */
31
- public function getConnection ()
32
- {
33
- return config ('passport.storage.database.connection ' );
34
- }
35
-
36
26
/**
37
27
* Run the migrations.
38
28
*
@@ -56,4 +46,14 @@ public function down()
56
46
{
57
47
$ this ->schema ->dropIfExists ('oauth_personal_access_clients ' );
58
48
}
49
+
50
+ /**
51
+ * Get the migration connection name.
52
+ *
53
+ * @return string|null
54
+ */
55
+ public function getConnection ()
56
+ {
57
+ return config ('passport.storage.database.connection ' );
58
+ }
59
59
}
Original file line number Diff line number Diff line change @@ -60,22 +60,22 @@ class AuthCode extends Model
60
60
protected $ keyType = 'string ' ;
61
61
62
62
/**
63
- * Get the current connection name for the model .
63
+ * Get the client that owns the authentication code .
64
64
*
65
- * @return string|null
65
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
66
66
*/
67
- public function getConnectionName ()
67
+ public function client ()
68
68
{
69
- return config ( ' passport.storage.database.connection ' ) ?? $ this ->connection ;
69
+ return $ this ->belongsTo (Passport:: clientModel ()) ;
70
70
}
71
71
72
72
/**
73
- * Get the client that owns the authentication code .
73
+ * Get the current connection name for the model .
74
74
*
75
- * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
75
+ * @return string|null
76
76
*/
77
- public function client ()
77
+ public function getConnectionName ()
78
78
{
79
- return $ this ->belongsTo (Passport:: clientModel ()) ;
79
+ return config ( ' passport.storage.database.connection ' ) ?? $ this ->connection ;
80
80
}
81
81
}
Original file line number Diff line number Diff line change @@ -65,16 +65,6 @@ public static function boot()
65
65
});
66
66
}
67
67
68
- /**
69
- * Get the current connection name for the model.
70
- *
71
- * @return string|null
72
- */
73
- public function getConnectionName ()
74
- {
75
- return config ('passport.storage.database.connection ' ) ?? $ this ->connection ;
76
- }
77
-
78
68
/**
79
69
* Get the user that the client belongs to.
80
70
*
@@ -189,4 +179,14 @@ public function getIncrementing()
189
179
{
190
180
return Passport::clientUuids () ? false : $ this ->incrementing ;
191
181
}
182
+
183
+ /**
184
+ * Get the current connection name for the model.
185
+ *
186
+ * @return string|null
187
+ */
188
+ public function getConnectionName ()
189
+ {
190
+ return config ('passport.storage.database.connection ' ) ?? $ this ->connection ;
191
+ }
192
192
}
Original file line number Diff line number Diff line change @@ -21,22 +21,22 @@ class PersonalAccessClient extends Model
21
21
protected $ guarded = [];
22
22
23
23
/**
24
- * Get the current connection name for the model .
24
+ * Get all of the authentication codes for the client .
25
25
*
26
- * @return string|null
26
+ * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
27
27
*/
28
- public function getConnectionName ()
28
+ public function client ()
29
29
{
30
- return config ( ' passport.storage.database.connection ' ) ?? $ this ->connection ;
30
+ return $ this ->belongsTo (Passport:: clientModel ()) ;
31
31
}
32
32
33
33
/**
34
- * Get all of the authentication codes for the client .
34
+ * Get the current connection name for the model .
35
35
*
36
- * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
36
+ * @return string|null
37
37
*/
38
- public function client ()
38
+ public function getConnectionName ()
39
39
{
40
- return $ this ->belongsTo (Passport:: clientModel ()) ;
40
+ return config ( ' passport.storage.database.connection ' ) ?? $ this ->connection ;
41
41
}
42
42
}
Original file line number Diff line number Diff line change @@ -59,16 +59,6 @@ class RefreshToken extends Model
59
59
*/
60
60
public $ timestamps = false ;
61
61
62
- /**
63
- * Get the current connection name for the model.
64
- *
65
- * @return string|null
66
- */
67
- public function getConnectionName ()
68
- {
69
- return config ('passport.storage.database.connection ' ) ?? $ this ->connection ;
70
- }
71
-
72
62
/**
73
63
* Get the access token that the refresh token belongs to.
74
64
*
@@ -98,4 +88,14 @@ public function transient()
98
88
{
99
89
return false ;
100
90
}
91
+
92
+ /**
93
+ * Get the current connection name for the model.
94
+ *
95
+ * @return string|null
96
+ */
97
+ public function getConnectionName ()
98
+ {
99
+ return config ('passport.storage.database.connection ' ) ?? $ this ->connection ;
100
+ }
101
101
}
Original file line number Diff line number Diff line change @@ -60,16 +60,6 @@ class Token extends Model
60
60
*/
61
61
public $ timestamps = false ;
62
62
63
- /**
64
- * Get the current connection name for the model.
65
- *
66
- * @return string|null
67
- */
68
- public function getConnectionName ()
69
- {
70
- return config ('passport.storage.database.connection ' ) ?? $ this ->connection ;
71
- }
72
-
73
63
/**
74
64
* Get the client that the token belongs to.
75
65
*
@@ -168,4 +158,14 @@ public function transient()
168
158
{
169
159
return false ;
170
160
}
161
+
162
+ /**
163
+ * Get the current connection name for the model.
164
+ *
165
+ * @return string|null
166
+ */
167
+ public function getConnectionName ()
168
+ {
169
+ return config ('passport.storage.database.connection ' ) ?? $ this ->connection ;
170
+ }
171
171
}
You can’t perform that action at this time.
0 commit comments