PHP code example of eduzz / activity-history-php

1. Go to this page and download the library: Download eduzz/activity-history-php 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/ */

    

eduzz / activity-history-php example snippets


// ...
'providers' => [
    // ...
    Eduzz\ActivityHistory\ActivityHistoryServiceProvider::class,
],

// ...
$app->configure('activityhistory');
// ...
$app->register(Eduzz\ActivityHistory\ActivityHistoryServiceProvider::class);
// ...

    $this->activityHistory->setUser(
        'application_user_id'
    );

    $this->activityHistory->setUrl('https://example.com');

    $oldData = [
        'name' => 'old name',
        'email' => '[email protected]'
    ];
    $beforeData = [
        'name' => 'new name',
        'email' => '[email protected]'
    ];

    $excerpt = [
        'name' => 'new name'
    ];

    $this->activityHistory->publish(
        new ProductUpdate(
            $excerpt,
            $oldData,
            $beforeData
        )
    );
sh
    php artisan vendor:publish --tag="config"