Laravel 7 API Crud is a basic RESTful API crud app built with Laravel 7 and Passport. In this project a rest api created for managing product crud operations.
Features (API) include:
- Laravel passport package
- Authentication using passport
- Logout to remove old tokens
- Create product.
- List products.
- Update product.
- Delete product
- Search By Title
- Pagination link with json data
This app created to help developers to get started with their api crud based apps.
Install commands:
- git clone https://github.com/nhrrob/laravel-7-api-crud.git
- composer update
- add .env and update database settings
- php artisan migrate:fresh --seed
- php artisan serve
Use Postman to test the API.
-
Login:
- URL: http://laravel-7-api-crud.rob/api/login
- Method: POST
- Insert email and password: Body tab => x-www-form-urlencode
- Press Enter to get Bearer token;
- For future request add this token:
Authorization tab: Type => Bearer Token; Insert token.
-
Insert/Update:
- Use Body tab => x-www-form-urlencode : Add title key and its value
- Another way: Body tab => raw : select json type
-
Demo User (database/seeders/DatabaseSeeder.php):
admin@admin.com/password
The Laravel 7 Crud is open-sourced software licensed under the MIT license.
Feel free to contact:
nazmulrobin.com | Twitter | Linkedin | Email