A RESTful API for a personal blog
- Users Resource
- Authentication using Laravel sanctum
- Scope based Authorization
- Seeding Database With Model Factory
- Event Handling
First, clone the repo:
$ git clone https://github.com/Ahmad-Faqehi/Ahmad-Blog-API.git
$ cd Ahmad-Blog-API
$ composer install
Create .env
file:
$ cat .env.example > .env
Todo: Add database config to .env file
Create .env
file:
$ php artisan key:generate
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 |
The Laravel framework is open-sourced software licensed under the MIT license.
Ahmad Faqehi - @A_F775 - alfaqehi775@hotmail.com
Project Link: https://github.com/Ahmad-Faqehi/Ahmad-Blog-API