1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- <?php
- namespace App\Events;
- use App\Models\SmsLog;
- use Illuminate\Queue\SerializesModels;
- use Illuminate\Broadcasting\PrivateChannel;
- use Illuminate\Foundation\Events\Dispatchable;
- use Illuminate\Broadcasting\InteractsWithSockets;
- use Illuminate\Support\Facades\Log;
- class SendTextMessage
- {
- use Dispatchable, InteractsWithSockets, SerializesModels;
- public $data;
- /**
- * Create a new event instance.
- * 发送短信
- * @return void
- */
- public function __construct($phone, $ip, $code, $content,$type)
- {
- $this->data = [
- 'phone' => $phone,
- 'ip_count' => $ip,
- 'code' => $code,
- 'content' => $content,
- 'type' => $type,
- ];
- }
- /**
- * Get the channels the event should broadcast on.
- *
- * @return \Illuminate\Broadcasting\Channel|array
- */
- public function broadcastOn()
- {
- return new PrivateChannel('channel-name');
- }
- }
|