public function testGetDefaultTable() { $this->setConfigTable(null, 'audits'); $audit = new Audit(); $table = $audit->getTable(); $this->assertEquals('audits', $table); }
/** * Audit the Auditable model. * * @param \OwenIt\Auditing\Contracts\Auditable $model * * @return \Illuminate\Database\Eloquent\Model */ public function audit(Auditable $model) { $report = Audit::create($model->toAudit()); if ($report) { $model->clearOlderAudits(); } return $report; }