-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1be7c92
commit be927d8
Showing
1 changed file
with
15 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,42 @@ | ||
# PHP-Automatic-CRUD | ||
PHP Automatic Crud Operations | ||
PHP Automatic Crud Operations Web API | ||
|
||
## What is PHP-Automatic-CRUD ? | ||
PHP-Automatic-CRUD is a PHP library that provides automatic CRUD operations for your database. | ||
|
||
## Installation | ||
- Realede version : [Download](https://github.com/hasaneryilmaz/PHP-Automatic-CRUD/releases "Download") | ||
- Put the api folder in your system directory. | ||
- or | ||
- Composer install : `composer create-project hascoding/webapi myapp` | ||
|
||
- Put the api folder in your system directory. | ||
- and | ||
- Make your database settings in api/DbConnect.php file. | ||
- | ||
- Import the hascoding_api_auth.sql file in the api folder into your database. | ||
- Create a new token from the hascoding_api_auth table in your database. | ||
- Everything is ready. | ||
|
||
## How to use ? | ||
|
||
> https://{sitename}/api/{table_name}/{table_column_name}/{id} | ||
> https://{sitename}/api/{table_name}/{table_column_name}/{id}?auth_key={auth_token} | ||
- auth_key = '3bb5e585b3b20a089ba46b7d55c74b50'; | ||
- table_name = 'users'; | ||
- table_column_name = 'Id'; | ||
- id = 1; | ||
|
||
> https://{sitename}/api/users/Id/1 | ||
> https://{sitename}/api/users/Id/1?auth_key=3bb5e585b3b20a089ba46b7d55c74b50 | ||
## Methods for {table_name} | ||
- GET: Get all records from {table_name} | ||
> https://{sitename}/api/{table_name} | ||
> https://{sitename}/api/{table_name}?auth_key={auth_token} | ||
- GET: Get a record from {table_name} by id | ||
> https://{sitename}/api/{table_name}/{table_column_name}/{id} | ||
> https://{sitename}/api/{table_name}/{table_column_name}/{id}?auth_key={auth_token} | ||
- POST: Create a new record in {table_name} | ||
> https://{sitename}/api/{table_name} | ||
> https://{sitename}/api/{table_name}?auth_key={auth_token} | ||
- PUT: Update a record in {table_name} by id | ||
> https://{sitename}/api/{table_name}/{table_column_name}/{id} | ||
> https://{sitename}/api/{table_name}/{table_column_name}/{id}?auth_key={auth_token} | ||
- DELETE: Delete a record in {table_name} by id | ||
> https://{sitename}/api/{table_name}/{table_column_name}/{id} | ||
> https://{sitename}/api/{table_name}/{table_column_name}/{id}?auth_key={auth_token} | ||
- DELETE: Delete all records in {table_name} | ||
> https://{sitename}/api/{table_name}/delete | ||
> https://{sitename}/api/{table_name}/delete?auth_key={auth_token} |