/Ahmad-Blog-API

Rest Full API for Ahmad blog

Primary LanguagePHP

REST API

A RESTful API for a personal blog

  • Users Resource
  • Authentication using Laravel sanctum
  • Scope based Authorization
  • Seeding Database With Model Factory
  • Event Handling

Getting Started

First, clone the repo:

$ git clone https://github.com/Ahmad-Faqehi/Ahmad-Blog-API.git

Install dependencies

$ cd Ahmad-Blog-API
$ composer install

Configure the Environment

Create .env file:

$ cat .env.example > .env

Todo: Add database config to .env file

Generate Key

Create .env file:

$ php artisan key:generate

API Routes

HTTP Method Path Action Scope Desciption
GET /posts index posts:list Get all posts
GET /post/{id} show post:read Read post
POST /post store post:create Create new post
DELETE /post/{id} delete post:delete Delete the post
POST /post/{id} update post:update Update the post
GET /categories index categories:list Get all categories
GET /category/{category_name} show category:read Get posts by category
POST /login show user:find User login
POST /register store user:create Create new user
POST /logout logout user:end End session of user

License

The Laravel framework is open-sourced software licensed under the MIT license.

Contact

Ahmad Faqehi - @A_F775 - alfaqehi775@hotmail.com

Project Link: https://github.com/Ahmad-Faqehi/Ahmad-Blog-API

LinkedIn Twitter Twitter