Skip to content

Commit 5dcc64a

Browse files
committed
fixes tests
1 parent 42b58db commit 5dcc64a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Services/Handler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Carbon\Carbon;
66
use Illuminate\Support\Collection;
77
use Illuminate\Support\Facades\File;
8+
use Illuminate\Support\Str;
89
use LaravelEnso\Helpers\Services\Decimals;
910

1011
abstract class Handler
@@ -14,11 +15,13 @@ abstract class Handler
1415
protected function log($file): array
1516
{
1617
$size = $this->formattedSize(File::size($file));
18+
$name = Str::afterLast($file, DIRECTORY_SEPARATOR);
19+
$extension = Str::afterLast($name, '.');
1720

1821
return [
1922
'name' => Collection::wrap(explode(DIRECTORY_SEPARATOR, $file))->last(),
2023
'size' => $size,
21-
'visible' => $size <= self::LogSizeLimit && $file->getExtension() === 'log',
24+
'visible' => $size <= self::LogSizeLimit && $extension === 'log',
2225
'modified' => Carbon::createFromTimestamp(File::lastModified($file)),
2326
];
2427
}

0 commit comments

Comments
 (0)