1. Go to this page and download the library: Download abdulbaset/activity-tracker 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/ */
abdulbaset / activity-tracker example snippets
use ActivityTracker;
// Simple activity logging
ActivityTracker::log('User Profile', 'User updated their profile');
// Detailed activity logging
ActivityTracker::log(
'Order Created',
'New order #123 was created',
[
'properties' => [
'order_id' => 123,
'amount' => 99.99
]
]
);
use Abdulbaset\ActivityTracker\Traits\Trackable;
class User extends Model
{
use Trackable;
}
use Abdulbaset\ActivityTracker\Resources\ActivityTrackerResource;
// In your controller
public function index()
{
$activities = ActivityTracker::latest()->paginate();
return ActivityTrackerResource::collection($activities);
}