FriendApply.php 493 B

123456789101112131415
  1. <?php
  2. use Faker\Generator as Faker;
  3. $factory->define(\App\Models\Friends\FriendApplyModel::class, function (Faker $faker) {
  4. $uids = \App\Models\User\UserModel::get()->pluck('uid')->toArray();
  5. return [
  6. 'last_at' => $faker->unixTime('now') - 7 * 86400 + rand(0, 7*86400),
  7. 'uid' => $faker->randomElement($uids),
  8. 'to_uid' => $faker->randomElement($uids),
  9. 'unread_cnt' => $faker->randomNumber(),
  10. 'state' => $faker->randomElement([0, 1])
  11. ];
  12. });