<?php

use App\Log;

if (!function_exists('save_log')) {
    function save_log($bd, $operation, $description = null, $user_matricule = null)
    {
        try {
            $log = new Log();
            $log->bd = $bd;
            $log->operation = $operation;
            $log->description = $description;
            $log->user_matricule = $user_matricule;
            $log->save();
            return;
        } catch (Exception $e) {
            return $e->getMessage();
        }
    }
}
