This is an Product CRUD API Project. Steps to install this project.
-
Download this repository.
-
Laravel version is 10 and php version is 8.1.
-
Go to the project location and run these commands.
- composer install
- npm install
- npm run dev
- Setup .env file to configure database and the run "php artisan migrate"
- php artisan db:seed
- php artisan serve
-
Go to these links to see the Rest APIs
- (All products) http://localhost:8000/api/products
- (Show single products) http://localhost:8000/api/products/30
- (Create product) http://localhost:8000/api/products
- (Update product) http://localhost:8000/api/products/25
- (All reviews for a product) http://localhost:8000/api/products/25/reviews
- (Show a reviewed product details) http://localhost:8000/api/products/25/reviews/3
-
To Secure data transmission by API you need to install Laravel Passport Package. You need to run this command to create grant token: "php artisan passport:install". Passport documentation is here https://laravel.com/docs/10.x/passport#installation