diff --git a/composer.json b/composer.json index 8604cd3..72cf14f 100644 --- a/composer.json +++ b/composer.json @@ -16,11 +16,7 @@ "require": { "php": ">=5.6", "firebase/php-jwt": "3.0.*", - "tymon/jwt-auth": "0.5.*", - "illuminate/contracts": "5.2.*", - "illuminate/auth": "5.2.*", - "illuminate/http": "5.2.*", - "illuminate/session": "5.2.*" + "laravel/framework": "5.2.*" }, "require-dev": { "phpunit/phpunit": "~4.0", diff --git a/src/TokenManager.php b/src/TokenManager.php index 49a39bd..ffabb61 100644 --- a/src/TokenManager.php +++ b/src/TokenManager.php @@ -4,6 +4,7 @@ use Carbon\Carbon; use Illuminate\Support\Facades\Config; +use Illuminate\Support\Facades\DB; class TokenManager implements Contract\TokenManager { @@ -39,7 +40,7 @@ public function add(Claim $claim) return; } - \DB::table($this->tokenTable)->insert([ + DB::table($this->tokenTable)->insert([ $this->userForeignKey => $claim->sub, 'token' => $claim->jti, 'created_at' => Carbon::now()->toDateTimeString(), @@ -55,7 +56,7 @@ public function add(Claim $claim) */ public function check(Claim $claim) { - $token = \DB::table($this->tokenTable) + $token = DB::table($this->tokenTable) ->where($this->userForeignKey, $claim->sub) ->where('token', $claim->jti)->first(); @@ -74,7 +75,7 @@ public function remove(Claim $claim) return false; } - \DB::table($this->tokenTable) + DB::table($this->tokenTable) ->where($this->userForeignKey, $claim->sub) ->where('token', $claim->jti)->delete(); @@ -89,7 +90,7 @@ public function remove(Claim $claim) */ public function removeAll($userId) { - return \DB::table($this->tokenTable) + return DB::table($this->tokenTable) ->where($this->userForeignKey, $userId) ->delete(); }