Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
laragear-rut-generation
laragear-rut-generation
laragear/rut
claude-code
rut
chilean-rut
generator
model-factories
random-generation
unique-constraints

Use this skill when generating mock or fake RUTs for database seeders, tests, factory definitions, or when generating fake data that requires also a fake RUT. Do not use in controllers, views, or jobs, unless the user explicitly requires it.

Install
php artisan boost:add-skill laragear/rut

Save this content to: .claude/skills/generation/SKILL.md

Generate mathematically correct, randomized Chilean RUTs with the `Generator` class facade.

# Generate random RUT

Use `makeOne` to create a single random RUT.

```php
use Laragear\Rut\Facades\Generator;

$rut = Generator::makeOne();
```

For targeted RUT generation (person, investors, investment companies, contingency, businesses, temporal, or definitive), use the apropiate builder method and use `makeOne()` for a single result, or `make($number)` for many.

```php
use Laragear\Rut\Facades\Generator;
    
// Generate a company RUT (> 50.000.000-*)
$companyRut = Generator::asCompanies()->makeOne();

// Generate 100 natural person RUTs (< 50,000,000) without duplicates on the request/command lifecicle.
$manyPeopleRuts = Generator::asPeople()->make(100);
```

Generate RUT constrained by numbers with `between()`.

```php
use Laragear\Rut\Facades\Generator;
    
$ruts = Generator::between(10_000_000, 30_000_000)->make(500);
```

Use `unique()` in the generator when RUT column of the model uses `unique()` or `primary()` indexes. This will avoid reusing the same RUT accidentally on generation, ensuring the database ingestion does not error because of PRIMARY/UNIQUE constraints.  

```php
use Laragear\Rut\Facades\Generator;
    
$ruts = Generator::unique()->make(100);
```

## On Model Factories

When a Model factory requires a RUT, set the rut attribute with the generator instance:

```php
use Illuminate\Support\Facades\Hash;
use Laragear\Rut\Facades\Generator;

public function definition()
{
    return [
        'name' => $this->faker->name,
        'rut' => Generator::asPeople()->makeOne(),
        'email' => $this->faker->email,
        'password' => static::$password ?? Hash::make('secret'),
    ];
}
```

Generate mathematically correct, randomized Chilean RUTs with the Generator class facade.

Generate random RUT

Use makeOne to create a single random RUT.

use Laragear\Rut\Facades\Generator;

$rut = Generator::makeOne();

For targeted RUT generation (person, investors, investment companies, contingency, businesses, temporal, or definitive), use the apropiate builder method and use makeOne() for a single result, or make($number) for many.

use Laragear\Rut\Facades\Generator;
    
// Generate a company RUT (> 50.000.000-*)
$companyRut = Generator::asCompanies()->makeOne();

// Generate 100 natural person RUTs (< 50,000,000) without duplicates on the request/command lifecicle.
$manyPeopleRuts = Generator::asPeople()->make(100);

Generate RUT constrained by numbers with between().

use Laragear\Rut\Facades\Generator;
    
$ruts = Generator::between(10_000_000, 30_000_000)->make(500);

Use unique() in the generator when RUT column of the model uses unique() or primary() indexes. This will avoid reusing the same RUT accidentally on generation, ensuring the database ingestion does not error because of PRIMARY/UNIQUE constraints.

use Laragear\Rut\Facades\Generator;
    
$ruts = Generator::unique()->make(100);

On Model Factories

When a Model factory requires a RUT, set the rut attribute with the generator instance:

use Illuminate\Support\Facades\Hash;
use Laragear\Rut\Facades\Generator;

public function definition()
{
    return [
        'name' => $this->faker->name,
        'rut' => Generator::asPeople()->makeOne(),
        'email' => $this->faker->email,
        'password' => static::$password ?? Hash::make('secret'),
    ];
}
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons
mmccook/php-json-canonicalization-scheme
middlewares/firewall
qubiqx/montapacking
nyoncode/laravel-package-console
pnscripts/filament-broadquill-lite
pnscripts/laravel-sentfold-lite
vleap/mx-sdk-laravel-internal
twidpay/utils
htetmyathlaing/scout-elasticsearch-driver
artisan-toolbox/front-awesome
ls/client-assistant
users-au/laravel-client
cgv/localized-resource