<?php


namespace App\Helpers;
use Illuminate\Support\Facades\Request;
use App\Models\LogActivity as LogActivityModel;
use App\Models\User;
use Illuminate\Support\Facades\Auth;

class LogActivity
{


    // public static function addToLog($subject,$subject_type,$subject_id,$log_name)
    public static function addToLog($subject,$subject_type,$subject_id,$causer_type,$causer_id,$branch,$log_name)
    {
    	$log = [];
    	
    	$log['description'] = $subject;
    	$log['log_name'] = $log_name;
    	$log['ip'] = Request::ip();
    	$log['agent'] = Request::header('user-agent');
		$log['subject_type'] = $subject_type;
    	$log['subject_id'] = $subject_id;
		$log['causer_type'] = $causer_type;
    	$log['causer_id'] = $causer_id;
    	$log['branch_id'] = $branch;
    	LogActivityModel::create($log);
    }


    public static function logActivityLists()
    {
    	return LogActivityModel::latest()->get();
    }


}