<?php

use App\Models\ActivityLog;

if (!function_exists('activity_log')) {

    function activity_log($action, $description = null)
    {
        ActivityLog::create([
            'user_id' => auth()->id(),
            'action' => $action,
            'description' => $description,
            'ip_address' => request()->ip(),
            'user_agent' => request()->userAgent(),
        ]);
    }

}