vendredi 28 septembre 2018

fzaninotto/faker Can you set random $count quantity of randomElements?

I am using this package to seed test data in my Laravel project.

For on field I am using this;

randomElements($array = array ('a','b','c'), $count = 1) // array('c')

My question is 2 parts;

a) can you make the $count value random? For example between 1-3.

b) I am using json_encode to avoid Array to string conversion but now values are being stored with ["example1", "example2"], how do I remove the [""]?

I understand storing arrays is not ideal but development has gone too far down this road.

Thanks!



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2R4bUZD
via IFTTT

Aucun commentaire:

Enregistrer un commentaire