Skip to content

Commit

Permalink
fix(Audit): revert the auditable() and user() method move from the tr…
Browse files Browse the repository at this point in the history
…ait to the model
  • Loading branch information
quetzyg committed Oct 25, 2018
1 parent fbaaef7 commit 5db0fbb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 17 deletions.
17 changes: 17 additions & 0 deletions src/Audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use DateTimeInterface;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;
use Illuminate\Support\Facades\Config;
use OwenIt\Auditing\Contracts\AttributeEncoder;

Expand All @@ -30,6 +31,22 @@ trait Audit
*/
protected $modified = [];

/**
* {@inheritdoc}
*/
public function auditable(): MorphTo
{
return $this->morphTo();
}

/**
* {@inheritdoc}
*/
public function user(): MorphTo
{
return $this->morphTo();
}

/**
* {@inheritdoc}
*/
Expand Down
17 changes: 0 additions & 17 deletions src/Models/Audit.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace OwenIt\Auditing\Models;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\MorphTo;

class Audit extends Model implements \OwenIt\Auditing\Contracts\Audit
{
Expand All @@ -22,20 +21,4 @@ class Audit extends Model implements \OwenIt\Auditing\Contracts\Audit
'new_values' => 'json',
'auditable_id' => 'integer',
];

/**
* {@inheritdoc}
*/
public function auditable(): MorphTo
{
return $this->morphTo();
}

/**
* {@inheritdoc}
*/
public function user(): MorphTo
{
return $this->morphTo();
}
}

0 comments on commit 5db0fbb

Please sign in to comment.