PHP code example of komicho / laravel-model-activity

1. Go to this page and download the library: Download komicho/laravel-model-activity 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/ */

    

komicho / laravel-model-activity example snippets


use Komicho\Laravel\ModelActivity\Activity;
// add
Activity::add(<user_id>, <item_id>, '<definition_flag>');

'definitions' => [
    '<definition_flag>' => '<definition_text>'
]

use Komicho\Laravel\ModelActivity\Traits\ModelActivity;

class User extends Authenticatable
{
    use ModelActivity;
    ...

Auth::user()->activitys;