PHP Classes


Recommend this page to a friend!
  Classes of uche  >  PHP Article System API  >  >  Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: PHP Article System API
Manage collections of articles using API requests
Author: By
Last change:
Date: 8 months ago
Size: 1,444 bytes


Class file image Download

About Project

This is an articles API that create, fetch, search, delete, update and rate articles. Authentication was implemented on endpoints that requires a user to create, update or delete an article using Laravel Passport. A user is thus required to pass the bearer token to these endpoints.

The endpoints for authentication:

Register a new user

Method - POST
Body - name, email, password

Login an existing user

Method - POST
Body -email, password

The endpoints for articles:

Create an article

Method ? POST
Body ? title, body

Get articles

Method ? GET

Get an article

Method ? GET

Update an article

Method ? PUT
Body - title, body

Delete an article

Method ? DELETE

Rate an article

Method ? POST
Body - rating (must be between 1 - 5)

Search for article

Method ? GET

To get started: + clone or download source code (unzip) + cd to project folder + Set database credentials in .env file + Run composer install + Run php artisan migrate for migrations + Run php artisan passport:install to set up encryption keys to generate tokens + Run php artisan serve to test endpoints + You can run php artisan db:seed to work with existing data

For more information send a message to info at phpclasses dot org.