<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
insenseanalytics / laravel-user-audit-trails example snippets
$table->usertrails(); // for created_by, updated_by
$table->deletetrails(); // for deleted_by
class Post extends \Illuminate\Database\Eloquent\Model
{
use \Insense\LaravelUserAuditTrails\HasUserTrails;
use \Insense\LaravelUserAuditTrails\HasDeleteTrails;
}
class BaseModel extends \Illuminate\Database\Eloquent\Model
{
use \Insense\LaravelUserAuditTrails\HasUserTrails;
use \Insense\LaravelUserAuditTrails\HasDeleteTrails;
}
class YourModel extends BaseModel
{
public static $CREATED_BY = 'your-created-by-column';
public static $UPDATED_BY = 'your-updated-by-column';
public static $DELETED_BY = 'your-deleted-by-column';
}
$table->usertrails('created_by', null);
class YourModel extends BaseModel
{
public static $CREATED_BY = 'created_by';
public static $UPDATED_BY = null;
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.