git clone https://github.com/olopezdeveloper/api-crud-laravel.git
cd api-crud-laravel
composer update
cp .env.example .env
DB_DATABASE=laravelapi
DB_USERNAME=root
DB_PASSWORD=mypassword
php artisan key:generate
php artisan jwt:secret
php artisan serve
You can use Postman to check the API:
POST | http://localhost:8000/api/register/
POST | http://localhost:8000/api/login/
key: Authorization value: bearer EXAMPLEEOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3Q6ODAwMFwvYXBpXC9sb2dpbiIsImlhdCI6MTU1MTYzOTI5MywiZXhwIjoxNTUxNjQyODkzLCJuYmYiOjE1NTE2MzkyOTMsImp0aSI6IlRJaVkzZ3JINHFSanE1N1YiLCJzdWIiOjUsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.sq85ijPIykMPnaZp2UkL0wfpPr9AhMMhUo86ttfe0a4EXAMPLE
GET | http://localhost:8000/api/products/
POST | http://localhost:8000/api/products/
GET | http://localhost:8000/api/products/2/
PUT | http://localhost:8000/api/products/2/
DELETE | http://localhost:8000/api/products/2/