diff --git a/app/Helpers/Slack.php b/app/Helpers/Slack.php index 9977b99..04ba3aa 100644 --- a/app/Helpers/Slack.php +++ b/app/Helpers/Slack.php @@ -3,22 +3,24 @@ namespace App\Helpers; use App\Models\Quote; +use Illuminate\Http\Client\Response; use Illuminate\Support\Facades\Http; class Slack { private string $url; - public function __construct() { + public function __construct() + { $this->url = config('bot.webhook'); } - private function send($text): \GuzzleHttp\Promise\PromiseInterface|\Illuminate\Http\Client\Response + private function send(string $text): Response { return Http::post($this->url, ['text' => $text]); } - public function sendText(string $text): \GuzzleHttp\Promise\PromiseInterface|\Illuminate\Http\Client\Response + public function sendText(string $text): Response { activity() ->event('send') @@ -27,7 +29,7 @@ class Slack return $this->send($text); } - public function sendQuote(Quote $quote): \GuzzleHttp\Promise\PromiseInterface|\Illuminate\Http\Client\Response + public function sendQuote(Quote $quote): Response { activity() ->performedOn($quote)