Skip to content

olopezdeveloper/api-crud-laravel

Repository files navigation

Getting Start Laravel API Simple CRUD 5.7

Clone the repository

git clone https://github.com/olopezdeveloper/api-crud-laravel.git

Enter to the Folder

cd api-crud-laravel

Get All Packets

composer update

Create .env File from .env.example

cp .env.example .env

Config your Database on .env file

DB_DATABASE=laravelapi DB_USERNAME=root DB_PASSWORD=mypassword

Generate key and jwt

php artisan key:generate php artisan jwt:secret

Finally Run this

php artisan serve

Check

You can use Postman to check the API:

First register you email and password

POST | http://localhost:8000/api/register/

Them get a token

POST | http://localhost:8000/api/login/

put your token in the header request

key: Authorization value: bearer EXAMPLEEOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodHRwOlwvXC9sb2NhbGhvc3Q6ODAwMFwvYXBpXC9sb2dpbiIsImlhdCI6MTU1MTYzOTI5MywiZXhwIjoxNTUxNjQyODkzLCJuYmYiOjE1NTE2MzkyOTMsImp0aSI6IlRJaVkzZ3JINHFSanE1N1YiLCJzdWIiOjUsInBydiI6Ijg3ZTBhZjFlZjlmZDE1ODEyZmRlYzk3MTUzYTE0ZTBiMDQ3NTQ2YWEifQ.sq85ijPIykMPnaZp2UkL0wfpPr9AhMMhUo86ttfe0a4EXAMPLE

Now you can use the folowin urls

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/

About

Basic API Rest Full on Laravel

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published