Test.php 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. namespace App\Console\Commands;
  3. use App\Models\Order;
  4. use App\Models\User;
  5. use App\Utils\CacheKey;
  6. use App\Utils\Helper;
  7. use Illuminate\Console\Command;
  8. use Illuminate\Filesystem\Filesystem;
  9. use Illuminate\Foundation\Console\ConfigCacheCommand;
  10. use Illuminate\Support\Facades\Cache;
  11. use Matriphe\Larinfo;
  12. class Test extends Command
  13. {
  14. /**
  15. * The name and signature of the console command.
  16. *
  17. * @var string
  18. */
  19. protected $signature = 'test';
  20. /**
  21. * The console command description.
  22. *
  23. * @var string
  24. */
  25. protected $description = '';
  26. /**
  27. * Create a new command instance.
  28. *
  29. * @return void
  30. */
  31. public function __construct()
  32. {
  33. parent::__construct();
  34. }
  35. /**
  36. * Execute the console command.
  37. *
  38. * @return mixed
  39. */
  40. public function handle()
  41. {
  42. $users = User::all();
  43. foreach ($users as $user) {
  44. $user->token = Helper::guid();
  45. $user->uuid = Helper::guid(true);
  46. $user->save();
  47. }
  48. }
  49. }