The amol/reactiveci4
helps to log activities of user in your website easily. It stores all activities in database table activity
.
It helps to boost your work speed.
- Easy setup.
- Use Codeigniter Models.
- Easy to use.
helper('reactive');
reactive($user, "You updated the profile");
use Amol\ReactiveCi4\Reactive;
$userModel = model('App\Models\UserModel');
$user = $userModel->find(1);
$properties = [
"ip" => "127.0.0.1"
];
$label = "profile review"
$record = new Reactive();
$record->log($user, "admin changed user's profile photo", $admin, $properties, $label);
you can install the package via composer.
composer require amol/reactiveci4
After installing. run spark
command
php spark reactive:setup
it will create Reactive
config and Activity
model file.
it also migrate activity
table.
has function log
public function log(object $subject, string $text, object $causer=null,array $properties=[], string $label=null ): id|false
It also provides helper
function reactive(object $subject, string $text, object $causer=null,array $properties=[], string $label=null )
return id of activity instance or false on failure.
You can use model to retrieve data from activity table and also do crud operations with it. You can also customize the model.
Label used to categories the record in different groups. You can change its default value using config file.
Coming soon
If you find any bugs. Dont hesitate to create a issue.
Please see CONTRIBUTING for details.