Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.x] Allow timestamps on Token model #1425

Merged
merged 1 commit into from
Mar 16, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/Token.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,6 @@ class Token extends Model
'expires_at',
];

/**
* Indicates if the model should be timestamped.
*
* @var bool
*/
public $timestamps = false;

/**
* Get the client that the token belongs to.
*
Expand Down
5 changes: 3 additions & 2 deletions tests/Unit/BridgeAccessTokenRepositoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Laravel\Passport\Tests\Unit;

use Carbon\CarbonImmutable;
use DateTime;
use Illuminate\Contracts\Events\Dispatcher;
use Laravel\Passport\Bridge\AccessToken;
use Laravel\Passport\Bridge\AccessTokenRepository;
Expand Down Expand Up @@ -32,8 +33,8 @@ public function test_access_tokens_can_be_persisted()
$this->assertSame('client-id', $array['client_id']);
$this->assertEquals(['scopes'], $array['scopes']);
$this->assertEquals(false, $array['revoked']);
$this->assertInstanceOf('DateTime', $array['created_at']);
$this->assertInstanceOf('DateTime', $array['updated_at']);
$this->assertInstanceOf(DateTime::class, $array['created_at']);
$this->assertInstanceOf(DateTime::class, $array['updated_at']);
$this->assertEquals($expiration, $array['expires_at']);
});

Expand Down