Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/afgprogrammer/php-mvc-book-library
book library rest-api in PHP MVC
https://github.com/afgprogrammer/php-mvc-book-library
php rest-api
Last synced: about 2 months ago
JSON representation
book library rest-api in PHP MVC
- Host: GitHub
- URL: https://github.com/afgprogrammer/php-mvc-book-library
- Owner: afgprogrammer
- Created: 2018-08-14T05:30:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-29T16:01:58.000Z (about 6 years ago)
- Last Synced: 2024-11-02T13:20:22.834Z (about 2 months ago)
- Topics: php, rest-api
- Language: PHP
- Homepage:
- Size: 35.2 KB
- Stars: 30
- Watchers: 4
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
In The Name Of Allah
# Book Rest API
This project is for searching books with rest API in PHP.
## Setup
### Step 1 - Clone or Download
```
git clone https://github.com/afgprogrammer/php-books-library.git```
### Step 2 - Change Config File
Please open config.php file and find this code section.
```PHP
// Config Database
define('DATABASE', [
'Port' => '3306',
'Host' => 'localhost',
'Driver' => 'PDO',
'Name' => '',
'User' => '',
'Pass' => '',
'Prefix' => ''
]);// DB_PREFIX
define('DB_PREFIX', '');
```
update it with your database credentials. you can choose a prefix and the prefix is optional.#### Example
My config.php file is like this```PHP
// Config Database
define('DATABASE', [
'Port' => '3306',
'Host' => 'localhost',
'Driver' => 'PDO',
'Name' => 'library',
'User' => 'root',
'Pass' => '',
'Prefix' => 'l_'
]);// DB_PREFIX
define('DB_PREFIX', 'l_');
```### Step 3 - Installation
After your updated config.php file. please open this path in your browser.
```
yourdomain.com/install
```If you see bellow message:
```
Your System Is Installed. Please remove SQL file in ...
```
It's Done.## Usage
You can see all the books and authors with bellow URL
```
yourdomain.com/all
```
For getting all books
```
yourdomain.com/books
```For getting all authors
```
yourdomain.com/authors
```
You can search books with title, ISBN and author name
```
yourdomain.com/books/title/your-book-title
yourdomain.com/books/isbn/your-book-isbn
yourdomain.com/books/author/your-book-author
```
And you can see results in other pages
```
yourdomain.com/books/your-page-number
yourdomain.com/authors/your-page-numberyourdomain.com/books/title/your-book-title/your-page-number
yourdomain.com/books/author/your-book-author/your-page-number
```and ...