<?php
namespace App\Helpers;
use Auth;

class CurrentUser{

    public static function getUserId()
    {
        if(isset(Auth::user()->id)){
            if(Auth::user()->role == 'superadmin'){
                $userId = Auth::user()->id;
            }else{
                $userId = Auth::user()->admin_id;
            }
        }else{
            $userId = null;
        }

        return $userId;
    }
}