1 | <?php |
||
12 | class Activity extends Model implements ActivityContract |
||
13 | { |
||
14 | public $guarded = []; |
||
15 | |||
16 | protected $casts = [ |
||
17 | 'properties' => 'collection', |
||
18 | ]; |
||
19 | |||
20 | 384 | public function __construct(array $attributes = []) |
|
32 | |||
33 | 232 | public function subject(): MorphTo |
|
34 | { |
||
35 | 232 | if (config('activitylog.subject_returns_soft_deleted_models')) { |
|
36 | 4 | return $this->morphTo()->withTrashed(); |
|
37 | } |
||
38 | |||
39 | 228 | return $this->morphTo(); |
|
40 | } |
||
41 | |||
42 | 48 | public function causer(): MorphTo |
|
46 | |||
47 | 16 | public function getExtraProperty(string $propertyName) |
|
51 | |||
52 | 148 | public function changes(): Collection |
|
60 | |||
61 | public function getChangesAttribute(): Collection |
||
65 | |||
66 | 16 | public function scopeInLog(Builder $query, ...$logNames): Builder |
|
74 | |||
75 | 8 | public function scopeCausedBy(Builder $query, Model $causer): Builder |
|
81 | |||
82 | 8 | public function scopeForSubject(Builder $query, Model $subject): Builder |
|
88 | |||
89 | public function scopeForEvent(Builder $query, string $event): Builder |
||
93 | } |
||
94 |