Laravel Service and Repository Pattern
Register user and create post using the Laravel Service and Repository Pattern.
- $ git clone https://github.com/vestusola/laravel-sr-pattern.git
- $ cd laravel-sr-pattern
- $ composer install
- $ php artisan key:generate
- $ php artisan migrate
- $ php artisan serve
- Test on postman
Name |
Url |
Method |
Data/Params |
register |
/api/register |
POST |
name,email,password,confirm_password |
login |
/api/login |
POST |
email,password |
Name |
Url |
Method |
Data/Params |
Header |
profile |
/api/user/profile |
GET |
|
Authorization |
Name |
Url |
Method |
Data/Params |
Header |
Fetch all posts |
/api/user/posts |
GET |
|
Authorization |
Add new post |
/api/user/posts |
POST |
title, description |
Authorization |
View post details |
/api/user/posts/{id} |
GET |
|
Authorization |
Update post details |
/api/user/posts/{id} |
PUT/PATCH |
title, description |
Authorization |
Delete post |
/api/user/posts/{id} |
DELETE |
|
Authorization |