Laravel 6.0 CRUD
Installation
- Clone repository
$ git clone https://github.com/risingworld777/laravel-crud-with-restful-api.git
- Enter folder
$ cd laravel-crud-with-restful-api
- Install composer dependencies
composer install
- Generate APP_KEY
php artisan key:generate
- Configure .env file, edit file with next command
$ nano .env
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=***
DB_PASSWORD=***
- Run migrations
php artisan migrate
- Create Server
php artisan serve
- Access project
http://127.0.0.1:8000/products
RESTful api
Checkout rest_api branch.
- Create Product API: Verb: POST, URL: http://localhost:8000/products
- All Products API: Verb: GET, URL: http://localhost:8000/products/
- Show Single Product API: Verb: GET, URL: http://localhost:8000/products/1
- Update Product API: Verb: PUT, URL: http://localhost:8000/products/1
- Delete Product API: Verb: DELETE, URL: http://localhost:8000/products/1