<?php

namespace App\Service;
use App\Models\Activity;
use Log;
use Auth;
use App\Models\AccountGroup;
use Carbon\Carbon;

class AccountGroupService
{
    //Update the account group current code 
    public function updateAccountGroup($module){

        $account_group = AccountGroup::where('name', 'Like', '%'.$module.'%')->first();
        if($account_group){
            $account_group->current_code = $account_group->current_code+1;
            $account_group->save();
        }

        return $account_group->current_code;
    }

}