private function logEventsToFile($model)
    {
        $user = auth()->user();
        $class = class_basename($model);
        $trace = debug_backtrace();
        $event = $trace[2] ? $trace[2]['function'] : "Unknown event";

        if (auth()->check()) {
            Log::info("{$class} id {$model->id} {$event} by user id {$user->id} ({$user->email}).");
        } else {
            Log::info("{$class} id {$model->id} {$event} by unknown user.");
        }
    }