<?php

namespace App\Controllers;

use CodeIgniter\API\ResponseTrait;

class Home extends BaseController
{
    use ResponseTrait;

    private $user;

    public function index()
    {
        $this->user = service("user_data"); 
        if($this->user->data->level == 'Admin'){
            return redirect()->to('admin/home');
        }if($this->user->data->level == 'User'){
            return redirect()->to('user/home');
        }
    }
}
