1. Go to this page and download the library: Download shipu/watchable 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/ */
shipu / watchable example snippets
activity()->log('Look, I logged something');
activity()
->on($anEloquentModel)
->data($storeWhatYouWantTo)
->log('Look, I logged something');
$lastLoggedActivity = Activity::all()->last();
$lastLoggedActivity->model; //returns an instance of an eloquent model
$lastLoggedActivity->causer; //returns an instance of your user model
$lastLoggedActivity->remarks; //returns 'Look, I logged something'
$user->name = 'updated name';
$user->save();
//updating the newsItem will cause the logging of an activity
$activity = Activity::all()->last();
$activity->remarks; //returns 'User Updated'
$activity->model; //returns the instance of NewsItem that was created