Skip to content

Commit 7ab3bdb

Browse files
committed
formatting
1 parent 555e02c commit 7ab3bdb

10 files changed

+89
-89
lines changed

config/passport.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,9 @@
5151
| Passport Storage Driver
5252
|--------------------------------------------------------------------------
5353
|
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.
5757
|
5858
*/
5959

database/migrations/2016_06_01_000001_create_oauth_auth_codes_table.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@ public function __construct()
2323
$this->schema = Schema::connection($this->getConnection());
2424
}
2525

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-
3626
/**
3727
* Run the migrations.
3828
*
@@ -59,4 +49,14 @@ public function down()
5949
{
6050
$this->schema->dropIfExists('oauth_auth_codes');
6151
}
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+
}
6262
}

database/migrations/2016_06_01_000002_create_oauth_access_tokens_table.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@ public function __construct()
2323
$this->schema = Schema::connection($this->getConnection());
2424
}
2525

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-
3626
/**
3727
* Run the migrations.
3828
*
@@ -61,4 +51,14 @@ public function down()
6151
{
6252
$this->schema->dropIfExists('oauth_access_tokens');
6353
}
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+
}
6464
}

database/migrations/2016_06_01_000003_create_oauth_refresh_tokens_table.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@ public function __construct()
2323
$this->schema = Schema::connection($this->getConnection());
2424
}
2525

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-
3626
/**
3727
* Run the migrations.
3828
*
@@ -57,4 +47,14 @@ public function down()
5747
{
5848
$this->schema->dropIfExists('oauth_refresh_tokens');
5949
}
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+
}
6060
}

database/migrations/2016_06_01_000005_create_oauth_personal_access_clients_table.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,6 @@ public function __construct()
2323
$this->schema = Schema::connection($this->getConnection());
2424
}
2525

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-
3626
/**
3727
* Run the migrations.
3828
*
@@ -56,4 +46,14 @@ public function down()
5646
{
5747
$this->schema->dropIfExists('oauth_personal_access_clients');
5848
}
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+
}
5959
}

src/AuthCode.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -60,22 +60,22 @@ class AuthCode extends Model
6060
protected $keyType = 'string';
6161

6262
/**
63-
* Get the current connection name for the model.
63+
* Get the client that owns the authentication code.
6464
*
65-
* @return string|null
65+
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
6666
*/
67-
public function getConnectionName()
67+
public function client()
6868
{
69-
return config('passport.storage.database.connection') ?? $this->connection;
69+
return $this->belongsTo(Passport::clientModel());
7070
}
7171

7272
/**
73-
* Get the client that owns the authentication code.
73+
* Get the current connection name for the model.
7474
*
75-
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
75+
* @return string|null
7676
*/
77-
public function client()
77+
public function getConnectionName()
7878
{
79-
return $this->belongsTo(Passport::clientModel());
79+
return config('passport.storage.database.connection') ?? $this->connection;
8080
}
8181
}

src/Client.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,6 @@ public static function boot()
6565
});
6666
}
6767

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-
7868
/**
7969
* Get the user that the client belongs to.
8070
*
@@ -189,4 +179,14 @@ public function getIncrementing()
189179
{
190180
return Passport::clientUuids() ? false : $this->incrementing;
191181
}
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+
}
192192
}

src/PersonalAccessClient.php

+8-8
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ class PersonalAccessClient extends Model
2121
protected $guarded = [];
2222

2323
/**
24-
* Get the current connection name for the model.
24+
* Get all of the authentication codes for the client.
2525
*
26-
* @return string|null
26+
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
2727
*/
28-
public function getConnectionName()
28+
public function client()
2929
{
30-
return config('passport.storage.database.connection') ?? $this->connection;
30+
return $this->belongsTo(Passport::clientModel());
3131
}
3232

3333
/**
34-
* Get all of the authentication codes for the client.
34+
* Get the current connection name for the model.
3535
*
36-
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
36+
* @return string|null
3737
*/
38-
public function client()
38+
public function getConnectionName()
3939
{
40-
return $this->belongsTo(Passport::clientModel());
40+
return config('passport.storage.database.connection') ?? $this->connection;
4141
}
4242
}

src/RefreshToken.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,6 @@ class RefreshToken extends Model
5959
*/
6060
public $timestamps = false;
6161

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-
7262
/**
7363
* Get the access token that the refresh token belongs to.
7464
*
@@ -98,4 +88,14 @@ public function transient()
9888
{
9989
return false;
10090
}
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+
}
101101
}

src/Token.php

+10-10
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,6 @@ class Token extends Model
6060
*/
6161
public $timestamps = false;
6262

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-
7363
/**
7464
* Get the client that the token belongs to.
7565
*
@@ -168,4 +158,14 @@ public function transient()
168158
{
169159
return false;
170160
}
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+
}
171171
}

0 commit comments

Comments
 (0)