Notification için pusher ekledim ve like attığımda bana hata veriyor
cURL error 1: Protocol "1" not supported or disabled in libcurl (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for 1://api-ap2.pusher.com:443/apps/1660262/events?auth_key=6bc3971302c7675a9d4f&auth_timestamp=1693391939&auth_version=1.0&body_md5=d03efcf35394f5896dfaaf5f07da298b&auth_signature=4d90b012083c79b6d8011c3bed7654072d605efe037bcc1dba68f8bc87d559e3
POST http://127.0.0.1:8000/tweets/9984/like 500 (Internal Server Error)
public function toogle(Tweet $tweet) {
$result = $tweet->likes()->toggle(auth()->id());
if(count($result['attached'])) {
$tweet->user->notify(new LikedTweetNotification($tweet, auth()->user())); // kırmızılı olarak burayı gösteriyor
}
$tweet->load('user')
->loadCount([
'likes',
'likes as liked' => function($q) {
$q->where('user_id', auth()->user()->id);
}
]);
return redirect()->back();
}
https://prnt.sc/fuXy7rOBUcbp
https://prnt.sc/OdSAyh6eY77a
https://prnt.sc/0GFw-_KHh-yy
Log kayıtları
[2023-08-30 10:38:59] local.ERROR: cURL error 1: Protocol "1" not supported or disabled in libcurl (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for 1://api-ap2.pusher.com:443/apps/1660262/events?auth_key=6bc3971302c7675a9d4f&auth_timestamp=1693391939&auth_version=1.0&body_md5=d03efcf35394f5896dfaaf5f07da298b&auth_signature=4d90b012083c79b6d8011c3bed7654072d605efe037bcc1dba68f8bc87d559e3 {"userId":1,"exception":"[object] (GuzzleHttp\\Exception\\RequestException(code: 0): cURL error 1: Protocol \"1\" not supported or disabled in libcurl (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for 1://api-ap2.pusher.com:443/apps/1660262/events?auth_key=6bc3971302c7675a9d4f&auth_timestamp=1693391939&auth_version=1.0&body_md5=d03efcf35394f5896dfaaf5f07da298b&auth_signature=4d90b012083c79b6d8011c3bed7654072d605efe037bcc1dba68f8bc87d559e3 at C:\\Users\\aghab\\OneDrive\\Desktop\\laravel-inertia-twitter-clone\\vendor\\guzzlehttp\\guzzle\\src\\Handler\\CurlFactory.php:211)
https://prnt.sc/gYU5oRlVlzNf
https://prnt.sc/MzwrY8_Bp9gg
Bu arada sonuç itibariyle like atılıyor fakat hatada çıkıyor
Not:
public function via(object $notifiable): array
{
return ['database', 'broadcast'];
}
broadcast eklediğim zaman hata alıyorum sildiğim zamansa hata vermiyor
Ek şeyler:
BROADCAST_DRIVER=pusher
bootstrap.js
import Echo from 'laravel-echo';
import Pusher from 'pusher-js';
window.Pusher = Pusher;
window.Echo = new Echo({
broadcaster: 'pusher',
key: import.meta.env.VITE_PUSHER_APP_KEY,
cluster: import.meta.env.VITE_PUSHER_APP_CLUSTER ?? 'mt1',
wsHost: import.meta.env.VITE_PUSHER_HOST ? import.meta.env.VITE_PUSHER_HOST : `ws-${import.meta.env.VITE_PUSHER_APP_CLUSTER}.pusher.com`,
wsPort: import.meta.env.VITE_PUSHER_PORT ?? 80,
wssPort: import.meta.env.VITE_PUSHER_PORT ?? 443,
forceTLS: (import.meta.env.VITE_PUSHER_SCHEME ?? 'https') === 'https',
enabledTransports: ['ws', 'wss'],
});
"pusher/pusher-php-server": "^7.2"
App\Providers\BroadcastServiceProvider::class,