بنقرة واحدة
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');