Skip to content

Commit

Permalink
🐛 Hotfix for unable hide the hidden attributes bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yungts97 committed Mar 16, 2022
1 parent b822fb6 commit a13b925
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Traits/ListenerTraits/HasData.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@

namespace Yungts97\LaravelUserActivityLog\Traits\ListenerTraits;

use Illuminate\Support\Arr;

trait HasData
{
protected function getData()
{
return $this->event_name === 'create' ?
$this->event->model->makeHidden($this->event->model->log_hidden ?? []) :
$this->event->model->makeHidden($this->event->model->log_hidden ?? [])->getRawOriginal();
Arr::except($this->event->model->toArray(), $this->event->model->log_hidden ?? []) :
Arr::except($this->event->model->getRawOriginal(), $this->event->model->log_hidden ?? []);
}
}

0 comments on commit a13b925

Please sign in to comment.