@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public $timestamps = false; |
| 26 | 26 | |
| 27 | - public function user(){ |
|
| 27 | + public function user() { |
|
| 28 | 28 | return $this->belongsTo('App\Model\User'); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | */ |
| 53 | 53 | public static function createRefreshToken(User $user) |
| 54 | 54 | { |
| 55 | - $refreshToken = md5(Helper::generateRandomString() . '_' . time()); |
|
| 55 | + $refreshToken = md5(Helper::generateRandomString().'_'.time()); |
|
| 56 | 56 | |
| 57 | 57 | $user->refresh_tokens()->create([ |
| 58 | 58 | 'refresh_token' => $refreshToken, |
@@ -24,7 +24,8 @@ |
||
| 24 | 24 | |
| 25 | 25 | public $timestamps = false; |
| 26 | 26 | |
| 27 | - public function user(){ |
|
| 27 | + public function user() |
|
| 28 | + { |
|
| 28 | 29 | return $this->belongsTo('App\Model\User'); |
| 29 | 30 | } |
| 30 | 31 | |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public $timestamps = false; |
| 26 | 26 | |
| 27 | - public function user(){ |
|
| 27 | + public function user() { |
|
| 28 | 28 | return $this->belongsTo('App\Model\User'); |
| 29 | 29 | } |
| 30 | 30 | |
@@ -56,7 +56,7 @@ discard block |
||
| 56 | 56 | try { |
| 57 | 57 | $payload = JWT::decode($token, getenv('SECRET_KEY'), ['HS256']); |
| 58 | 58 | return in_array($payload->aud, $whiteList); |
| 59 | - } catch (\Exception $e){ |
|
| 59 | + } catch (\Exception $e) { |
|
| 60 | 60 | return false; |
| 61 | 61 | } |
| 62 | 62 | } |
@@ -24,7 +24,8 @@ discard block |
||
| 24 | 24 | |
| 25 | 25 | public $timestamps = false; |
| 26 | 26 | |
| 27 | - public function user(){ |
|
| 27 | + public function user() |
|
| 28 | + { |
|
| 28 | 29 | return $this->belongsTo('App\Model\User'); |
| 29 | 30 | } |
| 30 | 31 | |
@@ -56,7 +57,7 @@ discard block |
||
| 56 | 57 | try { |
| 57 | 58 | $payload = JWT::decode($token, getenv('SECRET_KEY'), ['HS256']); |
| 58 | 59 | return in_array($payload->aud, $whiteList); |
| 59 | - } catch (\Exception $e){ |
|
| 60 | + } catch (\Exception $e) { |
|
| 60 | 61 | return false; |
| 61 | 62 | } |
| 62 | 63 | } |
@@ -4,8 +4,8 @@ discard block |
||
| 4 | 4 | class CreateUsersTable |
| 5 | 5 | { |
| 6 | 6 | /** |
| 7 | - * Do the migration |
|
| 8 | - */ |
|
| 7 | + * Do the migration |
|
| 8 | + */ |
|
| 9 | 9 | public function up() |
| 10 | 10 | { |
| 11 | 11 | Capsule::schema()->create('users', function($table) |
@@ -26,8 +26,8 @@ discard block |
||
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | /** |
| 29 | - * Undo the migration |
|
| 30 | - */ |
|
| 29 | + * Undo the migration |
|
| 30 | + */ |
|
| 31 | 31 | public function down() |
| 32 | 32 | { |
| 33 | 33 | Capsule::schema()->drop('users'); |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | |
| 4 | 4 | class CreateAccessTokensTable{ |
| 5 | 5 | /** |
| 6 | - * Do the migration |
|
| 7 | - */ |
|
| 6 | + * Do the migration |
|
| 7 | + */ |
|
| 8 | 8 | public function up() |
| 9 | 9 | { |
| 10 | 10 | Capsule::schema()->create('access_tokens', function($table) |
@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * Undo the migration |
|
| 22 | - */ |
|
| 21 | + * Undo the migration |
|
| 22 | + */ |
|
| 23 | 23 | public function down() |
| 24 | 24 | { |
| 25 | 25 | Capsule::schema()->drop('access_tokens'); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | use Illuminate\Database\Capsule\Manager as Capsule; |
| 3 | 3 | |
| 4 | -class CreateAccessTokensTable{ |
|
| 4 | +class CreateAccessTokensTable { |
|
| 5 | 5 | /** |
| 6 | 6 | * Do the migration |
| 7 | 7 | */ |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | use Illuminate\Database\Capsule\Manager as Capsule; |
| 3 | 3 | |
| 4 | -class CreateAccessTokensTable{ |
|
| 4 | +class CreateAccessTokensTable |
|
| 5 | +{ |
|
| 5 | 6 | /** |
| 6 | 7 | * Do the migration |
| 7 | 8 | */ |
| 8 | 9 | public function up() |
| 9 | 10 | { |
| 10 | - Capsule::schema()->create('access_tokens', function($table) |
|
| 11 | - { |
|
| 11 | + Capsule::schema()->create('access_tokens', function($table) { |
|
| 12 | 12 | $table->increments('id'); |
| 13 | 13 | $table->integer('user_id')->unsigned()->index(); |
| 14 | 14 | $table->string('access_token')->unique()->nullable(); |
@@ -3,8 +3,8 @@ discard block |
||
| 3 | 3 | |
| 4 | 4 | class CreateRefreshTokensTable{ |
| 5 | 5 | /** |
| 6 | - * Do the migration |
|
| 7 | - */ |
|
| 6 | + * Do the migration |
|
| 7 | + */ |
|
| 8 | 8 | public function up() |
| 9 | 9 | { |
| 10 | 10 | Capsule::schema()->create('refresh_tokens', function($table) |
@@ -18,8 +18,8 @@ discard block |
||
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
| 21 | - * Undo the migration |
|
| 22 | - */ |
|
| 21 | + * Undo the migration |
|
| 22 | + */ |
|
| 23 | 23 | public function down() |
| 24 | 24 | { |
| 25 | 25 | Capsule::schema()->drop('refresh_tokens'); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | use Illuminate\Database\Capsule\Manager as Capsule; |
| 3 | 3 | |
| 4 | -class CreateRefreshTokensTable{ |
|
| 4 | +class CreateRefreshTokensTable { |
|
| 5 | 5 | /** |
| 6 | 6 | * Do the migration |
| 7 | 7 | */ |
@@ -1,14 +1,14 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | use Illuminate\Database\Capsule\Manager as Capsule; |
| 3 | 3 | |
| 4 | -class CreateRefreshTokensTable{ |
|
| 4 | +class CreateRefreshTokensTable |
|
| 5 | +{ |
|
| 5 | 6 | /** |
| 6 | 7 | * Do the migration |
| 7 | 8 | */ |
| 8 | 9 | public function up() |
| 9 | 10 | { |
| 10 | - Capsule::schema()->create('refresh_tokens', function($table) |
|
| 11 | - { |
|
| 11 | + Capsule::schema()->create('refresh_tokens', function($table) { |
|
| 12 | 12 | $table->increments('id'); |
| 13 | 13 | $table->integer('user_id')->unsigned()->index(); |
| 14 | 14 | $table->string('refresh_token')->unique()->nullable(); |