Skip to content

Commit

Permalink
Update on requirement of composer to require laravel framework instea…
Browse files Browse the repository at this point in the history
…d, and import proper facade rather than using alias on TokenManager implementation
  • Loading branch information
wisoot committed Apr 29, 2016
1 parent d3bd6f3 commit 10ba760
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 1 addition & 5 deletions composer.json
Expand Up @@ -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",
Expand Down
9 changes: 5 additions & 4 deletions src/TokenManager.php
Expand Up @@ -4,6 +4,7 @@

use Carbon\Carbon;
use Illuminate\Support\Facades\Config;
use Illuminate\Support\Facades\DB;

class TokenManager implements Contract\TokenManager
{
Expand Down Expand Up @@ -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(),
Expand All @@ -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();

Expand All @@ -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();

Expand All @@ -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();
}
Expand Down

0 comments on commit 10ba760

Please sign in to comment.