Giter Site home page Giter Site logo

laravel-docker-api's Introduction

Larave 5.6 Api Controller

Install

1. Clone Project

  $ git clone https://github.com/vsarikaya/laravel-docker-api.git
  $ cd laravel-docker-api

2. Install

  $ docker-compose up -d
  $ docker exec app composer install
  $ docker exec app cp .env.example .env
  $ docker exec app php artisan key:generate
  $ docker exec app php artisan migrate | php artisan db:seed
  $ docker exec app php artisan passport:install

CURL

Get Token

curl -X POST \
  http://localhost:8080/api/userLogin \
  -H 'Accept: application/json' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Postman-Token: e4fde706-7905-0cbb-2951-77246fbb1264' \
  -d 'email=admin%40admin.com&password=admin'

Get All Categories

curl -X POST \
  http://localhost:8080/api/category/getAllCategories \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {__TOKEN_CODE__}' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'Postman-Token: c9455e9b-b650-fbab-4b70-699a4a6d3afe'

Get Category Musics With User Favorites

curl -X POST \
  http://localhost:8080/api/category/getCategoryWithMusicsByCategoryId \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {__TOKEN_CODE__}' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: 02312d66-95a6-266e-e741-0ce80a8c3cae' \
  -d '{
        "id" : 1,
        "user_id": 1
    }'

Add or Remove Favorite Music

curl -X POST \
  http://localhost:8080/api/category/addOrRemoveFromFavoriteList \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {__TOKEN_CODE__}' \
  -H 'Cache-Control: no-cache' \
  -H 'Content-Type: application/json' \
  -H 'Postman-Token: e4941b92-085a-ca72-008d-011d23698e50' \
  -d '{
	    "music_id" : 2,
	    "user_id": 1
    }'

Using

  Domain Driven Design
  Dependency Injection
  Logger
  Custom Exceptions
  Custom ResponseResult

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.