Skip to content

Commit

Permalink
formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed May 11, 2020
1 parent 555e02c commit 7ab3bdb
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 89 deletions.
6 changes: 3 additions & 3 deletions config/passport.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
| Passport Storage Driver
|--------------------------------------------------------------------------
|
| This configuration options determines the storage driver that will
| be used to store Passport's data. In addition, you may set any
| custom options as needed by the particular driver you choose.
| This configuration value allows you to customize the storage options
| for Passport, such as the database connection that should be used
| by Passport's internal database models which store tokens, etc.
|
*/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ public function __construct()
$this->schema = Schema::connection($this->getConnection());
}

/**
* Get the migration connection name.
*
* @return string|null
*/
public function getConnection()
{
return config('passport.storage.database.connection');
}

/**
* Run the migrations.
*
Expand All @@ -59,4 +49,14 @@ public function down()
{
$this->schema->dropIfExists('oauth_auth_codes');
}

/**
* Get the migration connection name.
*
* @return string|null
*/
public function getConnection()
{
return config('passport.storage.database.connection');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ public function __construct()
$this->schema = Schema::connection($this->getConnection());
}

/**
* Get the migration connection name.
*
* @return string|null
*/
public function getConnection()
{
return config('passport.storage.database.connection');
}

/**
* Run the migrations.
*
Expand Down Expand Up @@ -61,4 +51,14 @@ public function down()
{
$this->schema->dropIfExists('oauth_access_tokens');
}

/**
* Get the migration connection name.
*
* @return string|null
*/
public function getConnection()
{
return config('passport.storage.database.connection');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ public function __construct()
$this->schema = Schema::connection($this->getConnection());
}

/**
* Get the migration connection name.
*
* @return string|null
*/
public function getConnection()
{
return config('passport.storage.database.connection');
}

/**
* Run the migrations.
*
Expand All @@ -57,4 +47,14 @@ public function down()
{
$this->schema->dropIfExists('oauth_refresh_tokens');
}

/**
* Get the migration connection name.
*
* @return string|null
*/
public function getConnection()
{
return config('passport.storage.database.connection');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,6 @@ public function __construct()
$this->schema = Schema::connection($this->getConnection());
}

/**
* Get the migration connection name.
*
* @return string|null
*/
public function getConnection()
{
return config('passport.storage.database.connection');
}

/**
* Run the migrations.
*
Expand All @@ -56,4 +46,14 @@ public function down()
{
$this->schema->dropIfExists('oauth_personal_access_clients');
}

/**
* Get the migration connection name.
*
* @return string|null
*/
public function getConnection()
{
return config('passport.storage.database.connection');
}
}
16 changes: 8 additions & 8 deletions src/AuthCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,22 @@ class AuthCode extends Model
protected $keyType = 'string';

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

/**
* Get the client that owns the authentication code.
* Get the current connection name for the model.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
* @return string|null
*/
public function client()
public function getConnectionName()
{
return $this->belongsTo(Passport::clientModel());
return config('passport.storage.database.connection') ?? $this->connection;
}
}
20 changes: 10 additions & 10 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,6 @@ public static function boot()
});
}

/**
* Get the current connection name for the model.
*
* @return string|null
*/
public function getConnectionName()
{
return config('passport.storage.database.connection') ?? $this->connection;
}

/**
* Get the user that the client belongs to.
*
Expand Down Expand Up @@ -189,4 +179,14 @@ public function getIncrementing()
{
return Passport::clientUuids() ? false : $this->incrementing;
}

/**
* Get the current connection name for the model.
*
* @return string|null
*/
public function getConnectionName()
{
return config('passport.storage.database.connection') ?? $this->connection;
}
}
16 changes: 8 additions & 8 deletions src/PersonalAccessClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ class PersonalAccessClient extends Model
protected $guarded = [];

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

/**
* Get all of the authentication codes for the client.
* Get the current connection name for the model.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
* @return string|null
*/
public function client()
public function getConnectionName()
{
return $this->belongsTo(Passport::clientModel());
return config('passport.storage.database.connection') ?? $this->connection;
}
}
20 changes: 10 additions & 10 deletions src/RefreshToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,6 @@ class RefreshToken extends Model
*/
public $timestamps = false;

/**
* Get the current connection name for the model.
*
* @return string|null
*/
public function getConnectionName()
{
return config('passport.storage.database.connection') ?? $this->connection;
}

/**
* Get the access token that the refresh token belongs to.
*
Expand Down Expand Up @@ -98,4 +88,14 @@ public function transient()
{
return false;
}

/**
* Get the current connection name for the model.
*
* @return string|null
*/
public function getConnectionName()
{
return config('passport.storage.database.connection') ?? $this->connection;
}
}
20 changes: 10 additions & 10 deletions src/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@ class Token extends Model
*/
public $timestamps = false;

/**
* Get the current connection name for the model.
*
* @return string|null
*/
public function getConnectionName()
{
return config('passport.storage.database.connection') ?? $this->connection;
}

/**
* Get the client that the token belongs to.
*
Expand Down Expand Up @@ -168,4 +158,14 @@ public function transient()
{
return false;
}

/**
* Get the current connection name for the model.
*
* @return string|null
*/
public function getConnectionName()
{
return config('passport.storage.database.connection') ?? $this->connection;
}
}

0 comments on commit 7ab3bdb

Please sign in to comment.