this SDK을 사용하려는 두 개의 프로젝트가 있습니다. 하나는 Laravel 5.4이고 다른 하나는 Laravel 5.5입니다. Laravel 5.4 보내는 메시지와 함께 이 원활하게 진행하지만, Laravel 5.5 나는 다음과 같은 오류 있어요 : Laravel : 전보 SDK가 Laravel 5.5와 작동하지 않습니다.
코드는 다음과 같습니다
이use App\Http\Controllers\TelegramController;
.
.
.
TelegramController::sendNotification('contactMail', $params);
TelegramController :
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Validator;
use Telegram\Bot\Laravel\Facades\Telegram;
class TelegramController extends Controller {
public function getHome()
{
return view('/');
}
public function getUpdates()
{
$updates = Telegram::getUpdates();
dd($updates);
}
public static function sendNotification($type, $params){
switch($params['subject']){
case 'contact':
$subject = 'Contact';
break;
case 'pricequote':
$subject = 'PriceQuote';
break;
}
switch($type){
case 'contactMail':
$message = 'New message from:: ' . $params['email'] . ". Subject: " . $subject;
}
Telegram::sendMessage([
'chat_id' => 'mychatId',
'text' => $message,
]);
}
}
문제가 무엇인가를 ?
편집 : 나는/app.php config (설정) 할 줄을 추가하는 것을 잊었다
는을 찾을 수없는 것을,
가 지금은 다른 오류가 (씨 피라미드 감사합니다) TelegramOtherException
. 나는 그것을 다시 설치하지만, 아직도 내가 오류 가지고 :
어떻게 SDD를 설치 했습니까? – Yes92
''irazasyed/telegram-bot-sdk ':''2. *''을'composer.json'에'composer.json'에 넣었습니다. – Feralheart
내 대답을 확인하고 의사의 지시를 따르십시오. –