Have you solved this issue?
Oct 19, 2022
4
Level 5
Pusher error: cURL error 6: Could not resolve host: api-.pusher.com
i am trying to use pusher in my application , but i got the following problem
Pusher error: cURL error 6: Could not resolve host: api-.pusher.com
at it take place when i add channel to my broadcast event
ContactEvent
<?php
namespace App\Events;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class ContactEvent implements ShouldBroadcast
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct()
{
//
}
public function broadcastWith()
{
return [
'message' => 'Hello'
];
}
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|array
*/
public function broadcastOn()
{
return new PrivateChannel('contact');
}
}
model
class Contact extends Model
{
use HasFactory;
protected $fillable = ['name','surname','email','message'];
static function createInstance($request)
{
self::create($request);
broadcast(new ContactEvent('event'));
}
}
channel.php
Broadcast::channel('contact', function ($user, $orderId) {
return true;
});
Please or to participate in this conversation.