Skip to content

Commit

Permalink
Fix expired_at attribute definition
Browse files Browse the repository at this point in the history
  • Loading branch information
mchev committed Jan 7, 2024
1 parent d9fd13f commit 7172045
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/Models/Ban.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Ban extends Model

protected function expiredAt(): Attribute
{
return Attribute::make(
return new Attribute(
set: fn (null|string|Carbon $value) => (! is_null($value) && ! $value instanceof Carbon) ? Carbon::parse($value) : $value,
);
}
Expand Down
3 changes: 1 addition & 2 deletions tests/Unit/BlockByCountryMiddlewareTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,11 @@

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Log;
use Mchev\Banhammer\Exceptions\BanhammerException;
use Mchev\Banhammer\Middleware\BlockByCountry;
use Mchev\Banhammer\Services\IpApiService;
use Mockery;
use Mchev\Banhammer\Tests\TestCase;
use Mockery;

class BlockByCountryMiddlewareTest extends TestCase
{
Expand Down

0 comments on commit 7172045

Please sign in to comment.