<?php

namespace App\Models;

use CodeIgniter\Model;

class ChatModel extends Model
{
    protected $table = 'chat';
    protected $primaryKey = 'id'; // Assuming your primary key field name is 'id'

    protected $allowedFields = ['id', 'sender_id', 'reference_id', 'messages', 'media_url', 'date_sent', 'sender'];

    public function getChat($kode)
    {
        return $this->where('reference_id', $kode)->findall();
    }
}