Smithery Logo
MCPsSkillsDocsPricing
Login
NewFlame, an assistant that learns and improves. Available onTelegramSlack
    valec3

    backend-codeigniter-models

    valec3/backend-codeigniter-models
    Coding

    About

    SKILL.md

    Install

    • Telegram
      Telegram
    • Slack
      Slack
    • Claude Code
      Claude Code
    • Codex
      Codex
    • OpenClaw
      OpenClaw
    • Cursor
      Cursor
    • Amp
      Amp
    • GitHub Copilot
      GitHub Copilot
    • Gemini CLI
      Gemini CLI
    • Kilo Code
      Kilo Code
    • Junie
      Junie
    • Replit
      Replit
    • Windsurf
      Windsurf
    • Cline
      Cline
    • Continue
      Continue
    • OpenCode
      OpenCode
    • OpenHands
      OpenHands
    • Roo Code
      Roo Code
    • Augment
      Augment
    • Goose
      Goose
    • Trae
      Trae
    • Zencoder
      Zencoder
    • Antigravity
      Antigravity
    • Download skill
    ├─
    ├─
    └─
    Smithery Logo

    Give agents more agency

    Resources

    DocumentationPrivacy PolicySystem Status

    Company

    PricingAboutBlog

    Connect

    © 2026 Smithery. All rights reserved.

    About

    Model patterns, entity usage, query builder.

    SKILL.md

    Backend CodeIgniter Models

    When to use this skill

    • Database operations
    • Using entities
    • Query builder
    • Data validation

    Workflow

    • Extend CodeIgniter\Model
    • Define table and fields
    • Use entities for type safety
    • Enable validation
    • Use callbacks

    Instructions

    Model with Entity

    <?php
    
    namespace App\Models;
    
    use CodeIgniter\Model;
    
    class UserModel extends Model
    {
        protected $table = 'users';
        protected $primaryKey = 'id';
        protected $returnType = 'App\Entities\User';
        protected $allowedFields = ['name', 'email', 'password'];
        protected $useTimestamps = true;
        protected $validationRules = [
            'email' => 'required|valid_email|is_unique[users.email]',
            'password' => 'required|min_length[8]'
        ];
    
        protected $beforeInsert = ['hashPassword'];
    
        protected function hashPassword(array $data)
        {
            if (isset($data['data']['password'])) {
                $data['data']['password'] = password_hash($data['data']['password'], PASSWORD_DEFAULT);
            }
            return $data;
        }
    }
    

    Entity

    <?php
    
    namespace App\Entities;
    
    use CodeIgniter\Entity\Entity;
    
    class User extends Entity
    {
        protected $casts = [
            'id' => 'integer',
            'is_active' => 'boolean',
            'created_at' => 'datetime'
        ];
    
        public function setPassword(string $password)
        {
            $this->attributes['password'] = password_hash($password, PASSWORD_DEFAULT);
            return $this;
        }
    }
    

    Resources

    • Use entities for type safety
    • Enable validation in model
    • Use callbacks for data transformation
    Recommended Servers
    Supabase
    Supabase
    ThinAir Data
    ThinAir Data
    Local Model Suitability MCP
    Local Model Suitability MCP
    Repository
    valec3/agents.skills.md
    Files