Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.x] Return http response instead of body #48

Conversation

eiabea
Copy link
Contributor

@eiabea eiabea commented Jul 21, 2022

In order to do some kind of error handling or status code checking i propose to return the whole Response object instead of just the body

We had some issues with our auth key and would love to do something like this:

$response = Larafirebase::withTitle('Test Push from laravel command')
            ->withBody('Fingers crossed the device is getting this notification!')
            ->sendMessage($fcm);

if($response->statusCode() == 401){
  $this->info('Your auth key seems to be invalid');
}

.gitignore Outdated
@@ -0,0 +1 @@
vendor
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove this for now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in latest commit

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

return $this;
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linting FTW! 😄

@gentritabazi gentritabazi changed the title Return http response instead of body [1.x] Return http response instead of body Jul 21, 2022
@gentritabazi gentritabazi merged commit d8d10e4 into kutia-software-company:master Jul 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants