I want to get a min length of 1 and a max of 3.
I have tried $faker->username(1,3);
It's still producing usernames with higher lengths.
Also how can I make it to only have letters? Sometimes it has periods in the username.
<?php
use Faker\Generator as Faker;
$factory->define(App\User::class, function (Faker $faker) {
return [
'username' => $faker->username(1,3)
];
});
you can try to use
$faker->realText(mt_rand(1, 3))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With