GithubHelp home page GithubHelp logo

bungambohlah / ols-laravel Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 86 KB

This testing project from PT. Olsera Pratama Indonesia at Olsera.com

License: MIT License

Shell 0.77% PHP 83.02% JavaScript 0.50% Blade 15.71%
laravel php

ols-laravel's Introduction

OLS Laravel

This testing project from PT. Olsera Pratama Indonesia at Olsera.com

Table of Contents

Project Dependencies

  1. PHP min 7.4 for laravel 9.x
  2. MySQL
  3. Composer
  4. PhpMyAdmin (optional)

Setup project

  1. Clone the repository
  2. Create database with name ols-laravel via mysql CLI or phpmyadmin
  3. run composer install to install composer dependencies
  4. run php artisan migrate:fresh --seed to execute migration and seed
  5. run php artisan serve to run laravel server

List of API Routes

Pajak

  • Get Pajak

method: GET url: /pajak params: none response:

{
    "data": [
        {
            "id": 1,
            "nama": "pph",
            "rate": 0.05,
            "created_at": "2022-07-04T12:15:58.000000Z",
            "updated_at": "2022-07-04T12:15:58.000000Z"
        },
    ]
}
  • Create Pajak

    method: POST url: /pajak body:

    {
        "nama": "Pajak" (required),
        "rate": 0.05 (required | numerics)
    }

    response:

    {
        "data": {
            "nama": "Pajak E",
            "rate": "0.01",
            "updated_at": "2022-07-04T14:31:10.000000Z",
            "created_at": "2022-07-04T14:31:10.000000Z",
            "id": 5
        }
    }
  • Detail Pajak

    method: GET url: /pajak/{id} params: id:integer response:

    {
        "data": {
            "id": 3,
            "nama": "Pajak C",
            "rate": 0.03,
            "created_at": "2022-07-04T12:48:15.000000Z",
            "updated_at": "2022-07-04T12:48:15.000000Z"
        }
    
    }
  • Update Pajak

    method: PUT url: /pajak/{id} params: id:integer body:

    {
        "nama": "Pajak", (required)
        "rate": 0.05 (required | numerics)
    }

    response:

    {
        "data": {
            "id": 5,
            "nama": "Pajak D",
            "rate": "0.02",
            "created_at": "2022-07-04T14:31:10.000000Z",
            "updated_at": "2022-07-04T14:32:26.000000Z"
        }
    }
  • Delete Pajak

    method: DELETE url: /pajak/{id} params: id:integer

    response:

    {
        "data": null
    }

Item

  • Get Item with Pajak

method: GET url: /item params: none response:

{
    "data": [
        {
            "id": 1,
            "nama": "baju batik A",
            "created_at": "2022-07-04T12:15:58.000000Z",
            "updated_at": "2022-07-04T14:09:09.000000Z",
            "pajak": [
                {
                    "id": 1,
                    "nama": "pph",
                    "rate": 0.05,
                    "pajak": {
                        "item_id": 1,
                        "pajak_id": 1
                    }
                },
                {
                    "id": 3,
                    "nama": "Pajak C",
                    "rate": 0.03,
                    "pajak": {
                        "item_id": 1,
                        "pajak_id": 3
                    }
                }
            ]
        }
    ]
}
  • Create Item with Pajak

    method: POST url: /item body:

    {
        "nama": "Item", (required)
        "pajak_id": [1, 2] (required | array | min:2)
    }

    response:

    {
        "data": {
            "nama": "Item",
            "updated_at": "2022-07-04T14:34:45.000000Z",
            "created_at": "2022-07-04T14:34:45.000000Z",
            "id": 7,
            "pajak": [
                {
                    "id": 1,
                    "nama": "pph",
                    "rate": 0.05,
                    "pajak": {
                        "item_id": 7,
                        "pajak_id": 1
                    }
                },
                {
                    "id": 2,
                    "nama": "pajak toko",
                    "rate": 0.1,
                    "pajak": {
                        "item_id": 7,
                        "pajak_id": 2
                    }
                }
            ]
        }
    }
  • Detail Item with Pajak

    method: GET url: /item/{id} params: id:integer response:

    {
        "data": {
            "id": 1,
            "nama": "baju batik A",
            "created_at": "2022-07-04T12:15:58.000000Z",
            "updated_at": "2022-07-04T14:09:09.000000Z",
            "pajak": [
                {
                    "id": 1,
                    "nama": "pph",
                    "rate": 0.05,
                    "pajak": {
                        "item_id": 1,
                        "pajak_id": 1
                    }
                },
                {
                    "id": 3,
                    "nama": "Pajak C",
                    "rate": 0.03,
                    "pajak": {
                        "item_id": 1,
                        "pajak_id": 3
                    }
                }
            ]
        }
    }
  • Update Item with Pajak

    method: PUT url: /item/{id} params: id:integer body:

    {
        "nama": "Item", (required)
        "pajak_id": [1, 2] (required | array | min:2)
    }

    response:

    {
        "data": {
            "id": 1,
            "nama": "baju batik A",
            "created_at": "2022-07-04T12:15:58.000000Z",
            "updated_at": "2022-07-04T14:09:09.000000Z",
            "pajak": [
                {
                    "id": 1,
                    "nama": "pph",
                    "rate": 0.05,
                    "pajak": {
                        "item_id": 1,
                        "pajak_id": 1
                    }
                },
                {
                    "id": 3,
                    "nama": "Pajak C",
                    "rate": 0.03,
                    "pajak": {
                        "item_id": 1,
                        "pajak_id": 3
                    }
                }
            ]
        }
    }
  • Delete Item

    method: DELETE url: /item/{id} params: id:integer response:

    {
        "data": null
    }

About me

Hello there ๐Ÿ‘‹๐Ÿป, my name is Afif Abdillah Jusuf and I'm a software engineer.

I'm currently working as a Full Stack Developer.

Graduated from Politeknik Elektronika Negeri Surabaya as Associate Degree in Informatics Engineering.

Nice to meet you.

Visit my personal site at afif.dev

License

The Laravel framework is open-sourced software licensed under the MIT license.

ols-laravel's People

Contributors

bungambohlah avatar

Watchers

 avatar

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.