-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
Add support for posting content via a REST API #793
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really great, thanks @lukeraymonddowning 👏
I just made a few comments. Let me know what you think.
database/migrations/2019_12_14_000001_create_personal_access_tokens_table.php
Outdated
Show resolved
Hide resolved
@lukeraymonddowning can you maybe rebase with |
* Added check inside the create method of the RegisterController to find duplicate github ID * Added error message saying "We already found a user with the given GitHub account....... * fixed failing test * fixed stycli errors * styleci fixes * styleci fixes * more styleci fixes * wip Co-authored-by: Dries Vints <[email protected]>
* update dependencies * update classes * remove classes duplication * resolve conflict * Remove dependency Co-authored-by: faissaloux <[email protected]>
@driesvints rebased. UI is fine after the update 👍 |
I'll try to review all of this again this weekend. Thanks! |
This was a fantastic PR. Thank you so much for this @lukeraymonddowning 👏 I also opened an issue to follow up with some documentation eventually: #803. We'll try to look into that when we find some time. |
I'm not sure if I miss something but I think that there is currently no way to obtain the api token created by sanctum. The user profile only displays the hashed api token. The unhashed token should be displayed once after creating the api token was created (see docs) |
@SamuelNitsche you're right, an oversight by me. Going to push a fix later |
This PR adds a REST API that can be accessed by users to perform the following operations:
api.articles.store
api.articles.update
api.articles.delete
The idea is that bloggers could set up an API integration that would allow them to automatically publish content to Laravel IO when their articles go live. This would make it far easier to port content over to Laravel IO and increase article output.
These routes are protected by Laravel Sanctum. Tokens can be created and deleted from a user's profile settings page.
All 3 endpoints reuse the existing controllers, allowing for validation rules, request objects and more to be shared across HTTP and REST, reducing the amount of maintenance required to keep the API up to date.