Skip to content

Commit 5db0fbb

Browse files
committed
fix(Audit): revert the auditable() and user() method move from the trait to the model
1 parent fbaaef7 commit 5db0fbb

File tree

2 files changed

+17
-17
lines changed

2 files changed

+17
-17
lines changed

src/Audit.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use DateTimeInterface;
66
use Illuminate\Database\Eloquent\Model;
7+
use Illuminate\Database\Eloquent\Relations\MorphTo;
78
use Illuminate\Support\Facades\Config;
89
use OwenIt\Auditing\Contracts\AttributeEncoder;
910

@@ -30,6 +31,22 @@ trait Audit
3031
*/
3132
protected $modified = [];
3233

34+
/**
35+
* {@inheritdoc}
36+
*/
37+
public function auditable(): MorphTo
38+
{
39+
return $this->morphTo();
40+
}
41+
42+
/**
43+
* {@inheritdoc}
44+
*/
45+
public function user(): MorphTo
46+
{
47+
return $this->morphTo();
48+
}
49+
3350
/**
3451
* {@inheritdoc}
3552
*/

src/Models/Audit.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
namespace OwenIt\Auditing\Models;
44

55
use Illuminate\Database\Eloquent\Model;
6-
use Illuminate\Database\Eloquent\Relations\MorphTo;
76

87
class Audit extends Model implements \OwenIt\Auditing\Contracts\Audit
98
{
@@ -22,20 +21,4 @@ class Audit extends Model implements \OwenIt\Auditing\Contracts\Audit
2221
'new_values' => 'json',
2322
'auditable_id' => 'integer',
2423
];
25-
26-
/**
27-
* {@inheritdoc}
28-
*/
29-
public function auditable(): MorphTo
30-
{
31-
return $this->morphTo();
32-
}
33-
34-
/**
35-
* {@inheritdoc}
36-
*/
37-
public function user(): MorphTo
38-
{
39-
return $this->morphTo();
40-
}
4124
}

0 commit comments

Comments
 (0)