Skip to content

Commit

Permalink
Merge pull request #48 from codecovevienna/return-http-response-inste…
Browse files Browse the repository at this point in the history
…ad-of-body

[1.x] Return http response instead of body
  • Loading branch information
gentritabazi committed Jul 24, 2022
2 parents 0b24da9 + ccf653e commit d8d10e4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Services/Larafirebase.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace Kutia\Larafirebase\Services;

use Illuminate\Http\Client\Response;
use Illuminate\Support\Facades\Http;
use Kutia\Larafirebase\Exceptions\UnsupportedTokenFormat;

Expand Down Expand Up @@ -72,7 +73,7 @@ public function withSound($sound)

return $this;
}

public function withPriority($priority)
{
$this->priority = $priority;
Expand Down Expand Up @@ -142,13 +143,13 @@ public function send()
return $this->callApi($this->fromRaw);
}

private function callApi($fields)
private function callApi($fields): Response
{
$response = Http::withHeaders([
'Authorization' => 'key=' . config('larafirebase.authentication_key')
])->post(self::API_URI, $fields);

return $response->body();
return $response;
}

private function validateToken($tokens)
Expand Down

0 comments on commit d8d10e4

Please sign in to comment.