PHP code example of hosmelq / laravel-logsnag

1. Go to this page and download the library: Download hosmelq/laravel-logsnag 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/ */

    

hosmelq / laravel-logsnag example snippets


use HosmelQ\LogSnag\Laravel\Facades\LogSnag;

LogSnag::log()->publish([
    'channel' => 'waitlist',
    'event' => 'User Joined Waitlist',
    'icon' => '🎉',
]);

use HosmelQ\LogSnag\Laravel\Facades\LogSnag;

LogSnag::insight()->publish([
    'icon' => '🎉',
    'title' => 'Registered Users on Waitlist',
    'value' => 8,
]);

use HosmelQ\LogSnag\Laravel\Facades\LogSnag;

LogSnag::identify()->publish([
    'properties' => [
        'email' => '[email protected]',
        'name' => 'John Doe',
        'plan' => 'premium',
    ],
    'user_id' => '123',
]);

logsnag()->log()->publish([
    'channel' => 'waitlist',
    'event' => 'User Joined Waitlist',
    'icon' => '🎉',
]);
sh
php artisan vendor:publish --tag="logsnag-config"
sh
php artisan logsnag:install