namespace BookStack\Actions;
use BookStack\Entities\Models\Entity;
+use BookStack\Facades\Theme;
use BookStack\Interfaces\Loggable;
+use BookStack\Theming\ThemeEvents;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Support\Facades\Log;
}
$activity->save();
+
$this->setNotification($type);
$this->dispatchWebhooks($type, $detail);
+ Theme::dispatch(ThemeEvents::ACTIVITY_LOGGED, $type, $detail);
}
/**
*/
protected function newActivityForUser(string $type): Activity
{
- $ip = request()->ip() ?? '';
-
return (new Activity())->forceFill([
'type' => strtolower($type),
'user_id' => user()->id,
- 'ip' => config('app.env') === 'demo' ? '127.0.0.1' : $ip,
+ 'ip' => IpFormatter::fromCurrentRequest()->format(),
]);
}