use IlluminateSupportFacadesFile;
use CarbonCarbon;
$date = new Carbon($request->get('date', today()));
$filePath = storage_path("logs/laravel-{$date->format('Y-m-d')}.log");
$data = [];
if (File::exists($filePath)) {
$data = [
'lastModified' => new Carbon(File::lastModified($filePath)),
'size' => File::size($filePath),
'file' => File::get($filePath),
];
}
return $data;