This API is created using Laravel 5.8 API Resource. It has Users, Posts and Comments. Protected routes are also added. Protected routes are accessed via Passport access token.
- User
- Post
- Comment
Clone the project via git clone or download the zip file.
Copy contents of .env.example file to .env file. Create a database and connect your database in .env file.
cd into the project directory via terminal and run the following command to install composer packages.
then run the following command to generate fresh key.
then run the following command to create migrations in the databbase.
run the following command to install passport
then run the following command to generate the auth Scaffolding.
finally run the following command to seed the database with dummy content.
- User GET http://localhost:8000/api/v1/user
- Post GET All http://localhost:8000/api/v1/posts
- Post GET Single http://localhost:8000/api/v1/posts/1
- Post POST Create http://localhost:8000/api/v1/posts
- Post PUT Update http://localhost:8000/api/v1/posts/1
- Post DELETE destroy http://localhost:8000/api/v1/posts/1
Same For Comments.