diff --git a/src/Database/Concerns/WithReadied.php b/src/Database/Concerns/WithReadied.php index d8397405..2e7ccf3f 100644 --- a/src/Database/Concerns/WithReadied.php +++ b/src/Database/Concerns/WithReadied.php @@ -11,7 +11,7 @@ use Stancl\Tenancy\Events\ReadyingTenant; use Stancl\Tenancy\Events\TenantReadied; /** - * @property null|Carbon $readied + * @property $readied * * @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder withReadied(bool $withReadied = true) * @method static static|\Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Query\Builder onlyReadied() @@ -36,7 +36,7 @@ trait WithReadied */ public function initializeWithReadied() { - $this->casts['readied'] = 'datetime'; + $this->casts['readied'] = 'timestamp'; } diff --git a/tests/ReadiedTenantsTest.php b/tests/ReadiedTenantsTest.php index 2abc7d08..9bee8209 100644 --- a/tests/ReadiedTenantsTest.php +++ b/tests/ReadiedTenantsTest.php @@ -56,10 +56,10 @@ class ReadiedTenantsTest extends TestCase Artisan::call(CreateReadiedTenants::class); - config(['tenancy.readied.older_than_days' => 4]); + config(['tenancy.readied.older_than_days' => 2]); tenancy()->model()->query()->onlyReadied()->first()->update([ - 'readied' => now()->subDays() + 'readied' => now()->subDays(5)->timestamp ]); Artisan::call(ClearReadiedTenants::class);