A small helper for making translations has been added for use in factories:
This is what a few possible usages look like:
$this->translations('en', 'english')
$this->translations(['en', 'nl'], 'english')
$this->translations(['en', 'nl'], ['english', 'dutch'])
The helper can also be used outside of factories using the following syntax:
\Illuminate\Database\Eloquent\Factories\Factory::translations('en', 'english');
##In a Factory
class UserFactory extends \Illuminate\Database\Eloquent\Factories\Factory {
public function definition(): array
{
return [
'bio' => $this->translations('en', 'english'),
];
}
}