Loading skill
Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Model patterns, entity usage, query builder.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | -31% | 0% |
| case-12 | ✓→✓ | = Same ✓ | 59% | 0% |
| case-13 | ✓→✓ | = Same ✓ | -10% | 0% |
| case-02 | ✓→✓ | = Same ✓ | -22% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 55% | 0% |
php<?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; } }
php<?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; } }
Other measured skills in the registry, with their headline benchmark lift.