PHP code example of furqat / laravel-console-log

1. Go to this page and download the library: Download furqat/laravel-console-log library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

furqat / laravel-console-log example snippets


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));
    }
}