Inheritance: extends Illuminate\Database\Eloquent\Model
コード例 #1
0
 public function testGetDefaultTable()
 {
     $this->setConfigTable(null, 'audits');
     $audit = new Audit();
     $table = $audit->getTable();
     $this->assertEquals('audits', $table);
 }
コード例 #2
0
 /**
  * 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;
 }