SendMessage.php 910 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. namespace app\Jobs;
  3. use Illuminate\Bus\Queueable;
  4. use Illuminate\Queue\SerializesModels;
  5. use Illuminate\Queue\InteractsWithQueue;
  6. use Illuminate\Contracts\Queue\ShouldQueue;
  7. use Illuminate\Support\Facades\Log;
  8. class SendMessage implements ShouldQueue
  9. {
  10. use InteractsWithQueue, Queueable, SerializesModels;
  11. protected $class = null;
  12. protected $func = null;
  13. protected $condition = null;
  14. /**
  15. * Create a new job instance.
  16. *
  17. * @return void
  18. */
  19. public function __construct($class, $func, $condition)
  20. {
  21. $this->class = $class;
  22. $this->func = $func;
  23. $this->condition = $condition;
  24. }
  25. /**
  26. * Execute the job.
  27. *
  28. * @return void
  29. */
  30. public function handle()
  31. {
  32. $builder = call_user_func_array([$this->class, $this->func], $this->condition);
  33. dd($builder);
  34. //file_put_contents("")
  35. }
  36. }