<?php

namespace App\Models;

use CodeIgniter\Model;

class CommentModel extends Model
{
    protected $table = 'comments';
    protected $primaryKey = 'id';
    protected $allowedFields = ['username', 'message', 'created_at'];

    public function getAllComments()
    {
        return $this->orderBy('created_at', 'DESC')->findAll();
    }
}
