PHP code example of dkvhin / laravel-model-histories

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

    

dkvhin / laravel-model-histories example snippets



use Dkvhin\LaravelModelHistories\HasHistories;
use Dkvhin\LaravelModelHistories\HasHistoriesTrait;

class User extends Model implements HasHistories
{
    use HasHistoriesTrait;

    /**
     * Exclude from history
     * @var array<string>
     */
    public array $excludeFromHistory = [
        'password'
    ];
}


php artisan vendor:publish --provider="Dkvhin\LaravelModelHistories\LaravelModelHistoriesServiceProvider" --tag="config"

php artisan vendor:publish --provider="Dkvhin\LaravelModelHistories\LaravelModelHistoriesServiceProvider" --tag="migrations"