'How with faker to get text without ending “.”?

When in laravel 9 app I set value for text field with faker :

 $this->faker->unique()->text(25);

I see text for field ending with “.”. How can I get text without ending “.” ?

"laravel/framework": "^9.11",
"fakerphp/faker": "^1.9.1",

Thanks.



Solution 1:[1]

The author of the library decided not to implement this feature: https://github.com/fzaninotto/Faker/issues/1128

You can do it like:

substr(str_replace('.', '', $this->faker->unique()->text(25)), 0, 25);

You can adjust this to replace with specific symbol, if you need to have exactly 25 chars.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ross_102