-
base_url
ishttp:https://localhost/rest/public/
-
api_url
ishttp:https://localhost/rest/public/users
CREATE TABLE friends (
id int(11) AUTO_INCREMENT PRIMARY KEY,
name varchar(64) NOT NULL,
email varchar(64) NOT NULL,
phone varchar(16) DEFAULT NULL,
rollno int(7) NOT NULL,
company varchar(20) DEFAULT NULL
)
-
Clone this repo in
www
orhtdocs
directory. -
Change DB configuration in
bootstrap/app.php
and importresources/friends.sql
in a db. -
Install composer dependencies
composer install
-
Goto url
http:https://localhost/rest/public/users
Add chrome extension Postman which is a REST Api Client to test this application.
HTTP Method | Path | Action | Fields |
---|---|---|---|
GET | /users | index | |
GET | /users/{user_id} | index | |
POST | /users | Add | rollno (int), name, email, phone and company with header Content-Type: application/x-www-form-urlencoded |
PUT | /users/{user_id} | update | rollno (int), name, email, phone and company with header Content-Type: application/x-www-form-urlencoded |
DELETE | /users/{user_id} | destroy |
- Add OAuth 2.0 Support