PHP code example of mohit-hasan / laravel-activity-logger
1. Go to this page and download the library: Download mohit-hasan/laravel-activity-logger 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/ */
mohit-hasan / laravel-activity-logger example snippets
use MohitHasan\ActivityLogger\Traits\LogsActivity;
class Post extends Model
{
use LogsActivity;
}
use MohitHasan\ActivityLogger\Facades\ActivityLogger;
ActivityLogger::action('user_login')
->description('User logged in.')
->log();
$logs = ActivityLogger::getAll(); // all
$logs = ActivityLogger::getAll(action: 'created'); // filtered
$logs = ActivityLogger::getAll(for: $post); // for a model