PHP code example of cybernerdie / laravel-model-activity-log
1. Go to this page and download the library: Download cybernerdie/laravel-model-activity-log 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/ */
cybernerdie / laravel-model-activity-log example snippets
use RecordModelActivity;
protected static $eventsToRecord = ['created', 'updated'];
protected static $columnsToIgnore = ['email'];
$user = User::find(1);
$activities = ModelActivityLog::subjectBy($user)->get();
$activities = ModelActivityLog::event('created')->get();
$activities = ModelActivityLog::find(1)->changes();
bash
php artisan vendor:publish --provider="Cybernerdie\\ModelActivityLog\\ModelActivityLogServiceProvider"
bash
php artisan migrate