Skip to content

Instantly share code, notes, and snippets.

View xaviqv's full-sized avatar

Xavi xaviqv

  • Catalonia
View GitHub Profile
<?php
trait TracksHistoryTrait
{
protected function track(Model $model, callable $func = null, $table = null, $id = null)
{
// Allow for overriding of table if it's not the model table
$table = $table ?: $model->getTable();
// Allow for overriding of id if it's not the model id
$id = $id ?: $model->id;