1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace App\Jobs;
- use Illuminate\Bus\Queueable;
- use Illuminate\Contracts\Queue\ShouldQueue;
- use Illuminate\Foundation\Bus\Dispatchable;
- use Illuminate\Queue\InteractsWithQueue;
- use Illuminate\Queue\SerializesModels;
- use Pusher\Pusher;
- class SendOrderPusherNotification implements ShouldQueue
- {
- use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
- private $pusherData;
- /**
- * Create a new job instance.
- *
- * @return void
- */
- public function __construct($pusherData)
- {
- $this->pusherData = $pusherData;
- }
- /**
- * Execute the job.
- *
- * @return void
- */
- public function handle()
- {
- //
- $options = array(
- 'cluster' => env('PUSHER_APP_CLUSTER'),
- 'encrypted' => true
- );
- $pusher = new Pusher(
- env('PUSHER_APP_KEY'),
- env('PUSHER_APP_SECRET'),
- env('PUSHER_APP_ID'),
- $options
- );
- $pusher->trigger(env('PUHER_APP_CHANNEL'), 'App\\Events\\OrderNotification', $this->pusherData);
- }
- }
|