1. Go to this page and download the library: Download tasmir/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/ */
tasmir / activity-tracker example snippets
use Tasmir\ActivityTracker\Services\UserActivityService;
public function update(Request $request, Profile $profile, UserActivityService $service)
{
$profile->update($request->all());
$service->store(
$profile, // The model instance
Profile::class, // Model class name
'profile_update', // Action name
'User updated their profile information' // Description
);
}
'track_login' => true,
'track_logout' => true,
'track_url_visits' => true,
use Tasmir\ActivityTracker\Http\Middleware\TrackUrlVisit;
->withMiddleware(function (Middleware $middleware) {
$middleware->append(TrackUrlVisit::class);
})