Advertisement
Guest User

Untitled

a guest
Feb 5th, 2016
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.98 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Console\Commands;
  4.  
  5. use Illuminate\Console\Command;
  6.  
  7. class SayWinner extends Command
  8. {
  9. /**
  10. * The name and signature of the console command.
  11. *
  12. * @var string
  13. */
  14. protected $signature = 'winner';
  15.  
  16. /**
  17. * The console command description.
  18. *
  19. * @var string
  20. */
  21. protected $description = 'Get the random winner!';
  22.  
  23. /**
  24. * Users
  25. * @var [type]
  26. */
  27. private $users = [
  28. 'Tamaz Bagdavadze',
  29. 'Zura Gabievi',
  30. 'Guram Gunia',
  31. 'Levan Lotuashvili',
  32. 'Mako',
  33. 'Landish',
  34. 'Giorgi Bakashvili',
  35. 'Shalva Gelenidze',
  36. 'Shota Jolbordi',
  37. 'Dito Orkodashvili',
  38. 'Davit Khurtsidze',
  39. 'Giorgi Leivdze',
  40. 'Sandro Dolidze',
  41. 'Irakli the 5th',
  42. 'Guram Sutidze',
  43. 'Nana',
  44. 'Giorgi Goginashvili',
  45. 'Mariam Vardanidze',
  46. 'Giorgi Eufshi',
  47. 'Lasha Mgvdliashvili',
  48. 'Giorgi Beraia',
  49. 'Abesalomi Gogatishvili',
  50. 'Beqa Bendeliani',
  51. 'Giorgi Giorkhelidze',
  52. 'Levan Lekishvili',
  53. 'Ana Chikvaidze',
  54. 'Lasha Sumbadze',
  55. 'Ilya Gokadze',
  56. 'Ani Jujunashvili',
  57. 'Eka Vatsadze',
  58. 'Sergi Biganashvili',
  59. 'Giorgi Khachidze',
  60. 'Giorgi Pailodze',
  61. 'Mariam Komaxide',
  62. 'Salikh Gurgenidze',
  63. 'Merab Kutalia',
  64. 'Giorgi Monaselidze'
  65. ];
  66.  
  67.  
  68. /**
  69. * Create a new command instance.
  70. *
  71. * @return void
  72. */
  73. public function __construct()
  74. {
  75. parent::__construct();
  76. shuffle($this->users);
  77. }
  78.  
  79. /**
  80. * Execute the console command.
  81. *
  82. * @return mixed
  83. */
  84. public function handle()
  85. {
  86. sleep(2);
  87. $this->info('Thinking...');
  88. sleep(6);
  89. $this->info('Hmmmmm... And the Laracasts one month subscription goes to...');
  90. sleep(3);
  91. $this->info( last($this->users) );
  92. sleep(1);
  93. $this->info( 'Congrats!' );
  94. }
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement