PHP code example of oobook / snapshot

1. Go to this page and download the library: Download oobook/snapshot 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/ */

    

oobook / snapshot example snippets




namespace App\Models;

use Oobook\Snapshot\Traits\HasSnapshot;

class MyProduct extends Model
{
    use HasSnapshot;

    /**
     * The source model for the snapshot.
     *
     * Required
     *
     * @var Model
     */
    public $snapshotSourceModel = YourModel::class;

    /**
     * Fillable attributes to be copied from the source model.
     *
     * Optional
     *
     * @var array
     */
    public $snapshotSourceFillable = [];

    /**
     * Relationships to add to snapshot data.
     *
     * Optional
     *
     * @var array
     */
    public $snapshotSourceRelationships = [];
}

php artisan vendor:publish --tag="snapshot-config"