PHP code example of imsamurai / audit-log

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

    

imsamurai / audit-log example snippets


	CakePlugin::load('AuditLog', array('bootstrap' => true));
	

	public function currentUser() {
	  return AuthComponent::user();
	}
	

# Simple syntax accepting default options
class Task extends AppModel {
	public $actsAs = array( 'AuditLog.Auditable' );
	  
	# 
	# Additional model code.
	#
}

# Syntax with explicit options
class Task extends AppModel {
	public $actsAs = array(
		'AuditLog.Auditable' => array(
			'ignore' => array( 'active', 'name', 'updated' ),
			'habtm'  => array( 'Type', 'Project' )
		)
	);
	
	# 
	# Additional model code.
	#
}