<?php

namespace App\Controllers;

use App\Controllers\BaseController;

class NotifikasiController extends BaseController
{
    private $db;

    public function __construct()
    {
        $this->db = \Config\Database::connect();
    }

    public function readAll()
    {
        $userId = session()->get('id');
        $this->db->table('notifikasi')
            ->where('user_id', $userId)
            ->where('is_read', 0)
            ->update(['is_read' => 1]);
            
        return redirect()->back();
    }
}
