Search
 
SCRIPT & CODE EXAMPLE
 

PHP

Laravel log reader

composer require haruncpi/laravel-log-reader
Comment

laravel reading log file

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;
Comment

PREVIOUS NEXT
Code Example
Php :: php list all files in directory 
Php :: how to get array key in php 
Php :: PHP strip_tags — Strip HTML and PHP tags from a string 
Php :: php aes 
Php :: laravel request input default value 
Php :: laravel db raw count where 
Php :: convert collection to array laravel 
Php :: append in php 
Php :: remove last comma php 
Php :: php recortar string 
Php :: laravel get file to browser send 
Php :: PHP $argv echo 
Php :: checks if file is empty in php 
Php :: error pdo php Exception 
Php :: laravel resource 
Php :: laravel pagination 
Php :: Laravel 8 - get values of url query strings in controller 
Php :: laravel route pattern 
Php :: laravel vreeze 
Php :: woocommerce set default shipping country 
Php :: laravel eloquent multiple join 
Php :: twig in array 
Php :: Clear any previous error php 
Php :: yii2 sendemail extension 
Php :: php random number 
Php :: php round function Passing parameters with mode. 
Php :: Call to undefined method PsyUtilStr::random() 
Php :: php file date created older than 
Php :: call variable from inside a collection laravel 
Php :: symfony auto decode json request 
ADD CONTENT
Topic
Content
Source link
Name
9+6 =