원클릭으로
laragear-rut-eloquent
Manage Chilean RUTs in Eloquent models with custom casting and scopes.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Manage Chilean RUTs in Eloquent models with custom casting and scopes.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | laragear-rut-eloquent |
| description | Manage Chilean RUTs in Eloquent models with custom casting and scopes. |
Use this skill when storing, casting, or querying Chilean RUT attributes inside Eloquent models.
Locate the model that will use RUTs and add the Laragear\Rut\HasRut trait.
use Illuminate\Database\Eloquent\Model;
use Laragear\Rut\HasRut;
class User extends Model
{
use HasRut;
// ...
}
Ensure the Model migration contains the RUT columns:
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
public function up()
{
Schema::create('users', function (Blueprint $table) {
// ...
$table->rut(); // Add the RUT number and verification digit columns
// ...
});
}
}
Cast database strings automatically into Rut value objects for formatting helpers.
use Laragear\Rut\Casts\CastRut;
protected function casts()
{
return [
'rut' => CastRut::class,
];
}
When using the Laragear\Rut\HasRut trait in the model, the model query builder will have access to many RUT Local Scopes. Read that trait PHPDoc for a list of available methods.
use App\Models\User;
$user = User::findByRut('15.518.258-K');