PHP code example of thoth-pharaoh / operation-record

1. Go to this page and download the library: Download thoth-pharaoh/operation-record 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/ */

    

thoth-pharaoh / operation-record example snippets

bash
php artisan migrate
bash
php artisan vendor:publish --tag=operation-record-database --force
bash
php artisan vendor:publish --tag=operation-record-config --force
bash
$user = new \App\Models\User;
$user->operating($subject, $funcKey, $action, $old, $new, $ip);
bash
$post = new \App\Models\Post;
$post->operatedBy($operator, $funcKey, $action $old, $new, $ip);
bash
$post = new \App\Models\Post;
$records = $post->getSubjectRecords()->get();
bash
$dataTime = '2020-07-30 00:00:00'

OperationRecord::removeBefore($dataTime);
bash
$dataTime = '2020-07-30 00:00:00'

OperationRecord::removeAfter($dataTime);