<?php
namespace App\Controllers;

use App\Controllers\BaseController;

class Dashboard extends BaseController
{
    public function index()
    {
        if (!session()->get('logged_in')) {
            return redirect()->to('/login');
        }

        return view('dashboard/index', ['title' => 'Dashboard']);
    }
    
 	public function cerrarSesion(){
    	session()->destroy();
    	//return redirect()->to(base_url());
    	return redirect()->to('/login');
    }    
    

    public function logout()
    {
        session()->destroy();
        return redirect()->to('/login');
    }
        
}