<?php

namespace App\Controllers;

class Home extends BaseController
{
    public function index()
    {
        $user_data = service("user_data");
        if($user_data->data->group == 'admin'){
            return redirect()->to('home');
        }

        if($user_data->data->group == 'operator'){
            return redirect()->to('operator/home');
        }

        if($user_data->data->group == 'kolektor'){
            return redirect()->to('kolektor/home');
        }
        return view('welcome_message');
    }
}
