<?php

namespace App\Classes;

use App\Models\LogHistory;
use Illuminate\Support\Facades\Auth;

class EditLogHistory
{
    public function editLogSave($row, $type, $old_info, $new_info)
    {
        // dd('this is me');
        $log = new LogHistory();
        $log->log_type = $type;
        $log->log_id = $row->id;
        $log->old_info = json_encode($old_info);
        $log->new_info = json_encode($new_info);
        $log->edit_by = Auth::user()->id;
        $log->save();
    }
}
