PHP Classes

PHP Article System API: Manage collections of articles using API requests

Recommend this page to a friend!
  Info   View files Example   View files View files (96)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2022-01-15 (13 days ago) RSS 2.0 feedNot enough user ratingsTotal: 61 This week: 4All time: 10,033 This week: 45Up
Version License PHP version Categories
articles 1.0The PHP License5PHP 5, Content management, Web services
Description Author

This package can manage collections of articles using API requests.

It provides an application that handles HTTP request for an API that can perform several operations on collections of publishing articles.

Currently it implements several types of operations like:

- Register and login users that can access the API

- Create a new article

- Get a list of all articles

- Get an individual article

- Update an article

- Delete an article

- Rate an article

- Search for articles

Picture of uche
Name: uche <contact>
Classes: 6 packages by
Country: Nigeria Nigeria
Innovation award
Innovation award
Nominee: 5x

 

Details

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

/api/register
Method - POST
Body - name, email, password

Login an existing user

/api/login
Method - POST
Body -email, password

The endpoints for articles:

Create an article

/api/articles
Method ? POST
Body ? title, body

Get articles

/api/articles
Method ? GET

Get an article

/api/articles/{id}
Method ? GET

Update an article

/api/articles/{id}
Method ? PUT
Body - title, body

Delete an article

/api/articles/{id}
Method ? DELETE

Rate an article

/api/articles/{id}/rating
Method ? POST
Body - rating (must be between 1 - 5)

Search for article

/api/articles/search/{query}
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

  Files folder image Files  
File Role Description
Files folder image.idea (7 files)
Files folder imageapp (2 files, 5 directories)
Files folder imagebootstrap (1 file)
Files folder imageconfig (13 files)
Files folder imagedatabase (3 directories)
Files folder imagepublic (4 files, 2 directories)
Files folder imageresources (4 directories)
Files folder imageroutes (4 files)
Files folder imagetests (2 files, 2 directories)
Accessible without login Plain text file .editorconfig Data Auxiliary data
Accessible without login Plain text file .env.example Data Auxiliary data
Accessible without login Plain text file .styleci.yml Data Auxiliary data
Plain text file artisan Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file composer.lock Data Auxiliary data
Accessible without login Plain text file package.json Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file readme.md Doc. Documentation
Accessible without login Plain text file server.php Aux. Auxiliary script
Accessible without login Plain text file webpack.mix.js Data Auxiliary data

 Version Control Unique User Downloads Download Rankings  
 100%
Total:61
This week:4
All time:10,033
This week:45Up

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