This is a Laravel 8 Project make sure you have a php version for that. Laravel documentation
-
git clone
https://github.com/Bienfait-ijambo/wizard-engineer-laravel.git
-
cd in
wizard-engineer-laravel
-
Run
composer install
command -
Run
php artisan migrate
command for database -
Run
php artisan serve
command
NB: If you are not a laravel developper this is the Node Repo for final project []. If you are a laravel dev. make sure to create a env file and a db.
POST
Endpoint
/users
Request body
{
"name": "string",
"email": "string",
}
Response body
{
user: {
"name": "string",
"email": "string",
},
message:"user created !"
}
POST
Endpoint
/users
Request body
{
"email": "string",
"password": "string"
}
Response body
If user provider invalid credentials
{
"isLogged":false,
"message":"email or password invalid",
}
If user provider valid credentials
{
user: {
"name": "ben",
"email": "[email protected]",
},
"isLogged":true,
"message":"user logged",
"token":"$2b$10$0O.pVCtZO2QgxfPKh0WNsudCHglKsoGwhJ0GXciLYzHCa73x99Gpa"
}
POST
Endpoint
/logout
Request body
{
"userId": 1,
}
Response body with status 200
{
"message":"user logged out !"
}
POST
Endpoint
/posts
Request body
{
"title": "What is TypeScript",
"post_content":"content...."
}
Response body with status 200
{
"message":"Post created !"
}
PUT
Endpoint
/posts/:id
Request body
{
"title": "What is TypeScript",
"post_content":"content...."
}
Response body with status 200
{
"message":"Post created !"
}
DELETE
Endpoint
/posts/:id
Request body
Response body with status 200
{
"message":"Post deleted !"
}
POST
Endpoint
/posts/upload-image
Request body
{
"postId": "number",
"image":"binary"
}
Response body with status 200
{
"message":"Post image uploaded !"
}
This endpoints is used to display details of a single post
GET
Endpoint
/posts/:slug
Response body with status 200
[
{
"id": 8,
"title": "What is TypeScript",
"post_content": "<p></p>",
"image": "http://127.0.0.1:8000/storage/images/1711706289.jpg",
"slug": "what-is-typescript-xGckmQ1711806376",
"created_at": "2024-03-11T17:44:03.000000Z",
"updated_at": "2024-03-30T13:46:16.000000Z"
}
]
Display list of posts on the home page of our vue app
GET
Endpoint
/posts?query=
Response body with status 200
{
"data": [
{
"id": 3,
"title": "What is Golang ?",
"post_content": "<p>",
"image": "http://127.0.0.1:8000/storage/images/1711706163.jpg",
"slug": "what-is-golang-lZg1Ap1711810344",
"created_at": "2024-03-10 14:32:29",
"updated_at": "2024-03-30 14:52:24"
}
]
}
GET
Endpoint
/count/posts
Response body with status 200
{
"data": 5
}
GET
Endpoint
/check/user/loggedin
Response body with status 200
{
"success": true
}
GET
Endpoint
/client/posts
Response body with status 200
[
{
"id": 5,
"title": "What is TypeScript",
"post_content": "",
"image": "http://127.0.0.1:8000/storage/images/1715743244.jpg",
"slug": "what-is-typescript-8yXHkQ1715743297",
"created_at": "2024-05-15 03:20:05",
"updated_at": "2024-05-15 03:21:37"
},
]