Closed LAMPEngineer closed 3 years ago
Log::info(print_r($user, true));
The true in the second parameter of the print_r() method returns the information instead of printing it, which allows the Log facade to print it like a string.
log either by print_r or json_encode. json_encode is more readable.
use Illuminate\Support\Facades\Log;
Log::info(json_encode($user));
Done!
Laravel log an instance or array: