jeremymouton
Is it possible to extend a third-party plugin's model to log changes using the extend method?
Something like this in the plugin's boot method:
<?php namespace Name\MyPlugin;
use Backend;
use System\Classes\PluginBase;
use Acme\Ecommerce\Models\Order as OrderModel;
use \Jacob\Logbook\Traits\LogChanges;
/**
* Plugin Information File
*/
class Plugin extends PluginBase
{
...
/**
* Boot method, called right before the request route.
*
* @return array
*/
public function boot()
{
OrderModel::extend(function($model) {
$model->addIgnoreFieldsLogbook('updated_at');
$model->addDeleteLogbookAfterDelete(false);
});
}
...
}
Thanks!
1-1 of 1