furqat / laravel-console-log
This package allows backend developers to effortlessly output messages and values in the terminal, serving as the PHP equivalent of console log for Laravel.
Fund package maintenance!
Furqatbek Mashrabjonov
Requires
- php: ^8.2
- illuminate/contracts: ^10.0||^11.0
- spatie/laravel-package-tools: ^1.16
Requires (Dev)
- larastan/larastan: ^2.9
- laravel/pint: ^1.14
- nunomaduro/collision: ^8.1.1||^7.10.0
- orchestra/testbench: ^9.0.0||^8.22.0
- pestphp/pest: ^2.34
- pestphp/pest-plugin-arch: ^2.7
- pestphp/pest-plugin-laravel: ^2.3
- phpstan/extension-installer: ^1.3
- phpstan/phpstan-deprecation-rules: ^1.1
- phpstan/phpstan-phpunit: ^1.3
README
Laravel Console Log
This package allows backend developers to effortlessly output messages and values in the browser's console via PHP.
Installation
You can install the package via composer:
composer require furqat/laravel-console-log
Usage
class HomeController extends Controller { public function index() { $users = User::all(); //it will show the count of users in the console of browser console()->info('The count of users is: ' . $users->count()); return view('users', compact($users)); } }
How It Works
When you call console()->log(...$args) in your Laravel application, the package stores the logged messages and values in the cache. This allows the logs to be easily accessed and managed without cluttering the terminal or log files.
To view these logs, simply open any view in your browser. The package streams the cached logs to the frontend in real-time and show logs in browser's console using console.log(), providing a clear and organized view of all your log entries. This makes it easy for developers to monitor and debug their applications without interrupting their workflow.
Testing
composer test
Changelog
Please see CHANGELOG for more information on what has changed recently.
Credits
License
The MIT License (MIT). Please see License File for more information.