Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jeddsaliba/php-crud
https://github.com/jeddsaliba/php-crud
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/jeddsaliba/php-crud
- Owner: jeddsaliba
- Created: 2024-02-29T03:07:12.000Z (10 months ago)
- Default Branch: master
- Last Pushed: 2024-02-29T04:35:53.000Z (10 months ago)
- Last Synced: 2024-03-01T04:27:03.891Z (10 months ago)
- Language: PHP
- Size: 74.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Import the MySQL Database
Download and import the database [here](https://github.com/jeddsaliba/php-crud/tree/master/database).## Change Database Credentials
Open `db.php` and change the `$server`, `$database`, `$username` and `$password`.## Run Development Server
Run the php server by running this command:```bash
php -S localhost:8000
```## Features
- [Fetch Data](#fetch-data)
- [Insert/Store Data](#insert-store-data)
- [Fetch Single Record](#fetch-single-record)
- [Update Data](#update-data)
- [Delete Data](#delete-data)**URL**
```bash
{{url}}/list.php
```**Method**
```bash
GET
```**Sample Response**
```bash
[
{
"id": "1",
"created_by": "5",
"name": "asd2",
"description": "this description",
"created_at": "2024-02-28 16:18:39",
"updated_at": "2024-02-28 16:18:39",
"deleted_at": null
},
{
"id": "2",
"created_by": "24",
"name": "Vel est molestiae.",
"description": "Aut iure aut atque sint magnam tenetur totam cupiditate. Sed eveniet ipsam illum quod cum aliquid sed. Et eligendi repudiandae voluptatem nisi et rerum. Est accusamus delectus sapiente pariatur earum. A veritatis magnam sit rerum. Vitae molestiae facere sint excepturi dolor distinctio.",
"created_at": "2024-02-28 16:18:39",
"updated_at": "2024-02-28 16:18:39",
"deleted_at": null
},
{
"id": "3",
"created_by": "18",
"name": "Numquam quis consequatur blanditiis magni.",
"description": "Odit excepturi sequi accusamus perferendis in in aut. Id quia quaerat ea tenetur pariatur sunt et nulla. Dolor est corrupti ullam sapiente saepe doloremque et et. Animi illo nemo odit dicta quia pariatur sit voluptatibus. Quae dolores quas et.",
"created_at": "2024-02-28 16:18:39",
"updated_at": "2024-02-28 16:18:39",
"deleted_at": null
},
{
"id": "4",
"created_by": "10",
"name": "Quia corrupti laboriosam.",
"description": "Rerum et nemo quis at sed beatae molestiae. Et dolore vitae eum natus architecto. Omnis fugiat enim qui. Necessitatibus nobis aliquam inventore autem.",
"created_at": "2024-02-28 16:18:39",
"updated_at": "2024-02-28 16:18:39",
"deleted_at": null
},
{
"id": "5",
"created_by": "9",
"name": "Quo aut dignissimos recusandae.",
"description": "Consequatur cumque aut tempora eaque deserunt pariatur. Qui molestiae necessitatibus quae aspernatur vel. Aut molestiae qui animi aperiam fuga. Aut vitae nobis impedit molestiae qui.",
"created_at": "2024-02-28 16:18:39",
"updated_at": "2024-02-28 16:18:39",
"deleted_at": null
}
]
```**URL**
```bash
{{url}}/save.php
```**Payload**
```bash
{
"name": "This Project Name",
"description": "This Description"
}
```**Method**
```bash
POST
```**Sample Response**
```bash
{
"id": "54",
"created_by": "1",
"name": "New Project",
"description": "New Project Description",
"created_at": null,
"updated_at": null,
"deleted_at": null
}
```**URL**
```bash
{{url}}/get.php?id=1
```**Method**
```bash
GET
```**Sample Response**
```bash
{
"id": "2",
"created_by": "24",
"name": "Vel est molestiae.",
"description": "Aut iure aut atque sint magnam tenetur totam cupiditate. Sed eveniet ipsam illum quod cum aliquid sed. Et eligendi repudiandae voluptatem nisi et rerum. Est accusamus delectus sapiente pariatur earum. A veritatis magnam sit rerum. Vitae molestiae facere sint excepturi dolor distinctio.",
"created_at": "2024-02-28 16:18:39",
"updated_at": "2024-02-28 16:18:39",
"deleted_at": null
}
```**URL**
```bash
{{url}}/update.php
```**Payload**
```bash
{
"name": "Updated Project Name",
"description": "Updated Project Description",
"id": 1
}
```**Method**
```bash
PUT
```**Sample Response**
```bash
{
"id": "1",
"created_by": "5",
"name": "Updated Project Name",
"description": "Updated Project Description",
"created_at": "2024-02-28 16:18:39",
"updated_at": "2024-02-28 16:18:39",
"deleted_at": null
}
```**URL**
```bash
{{url}}/delete.php
```**Method**
```bash
DELETE
```**Payload**
```bash
{
"id": 1
}
```**Sample Response**
```bash
deleted
```