FeatureFactory.php 454 B

12345678910111213141516
  1. <?php
  2. /** @var \Illuminate\Database\Eloquent\Factory $factory */
  3. use App\Feature;
  4. use Faker\Generator as Faker;
  5. $factory->define(Feature::class, function (Faker $faker) {
  6. $type = [0,1,2,3,4,5];
  7. $logic = ['包含','不包含','等于'];
  8. return [
  9. "type" => $type[array_rand($type)], //类型
  10. "logic" => $logic[array_rand($logic)], //逻辑
  11. "describe" => \Illuminate\Support\Str::random(5), //特征
  12. ];
  13. });