lupuxyz / a-rest

Rest APIs with SLIM 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

a-rest

Libs

  1. Eloquent - ORM DB
  2. Twig - Template
  3. Respect Validation - Validation
  4. PHPMailer - Mailler


Config

Import database
    |--- /database/asmith_rest.sql
Database setting
    |--- /booting/app.php

Email config
Go to booting/app.php and change username and password as yours.
if your want to make a custom body you can delete or comment on line 270,
in AuthController and your cant put your custom body email in folder resources/view/email.twig

folder dan file

root |
     |---App |--/Controllers
     |       |       |---/Controller.php
     |       |--/Mailer
     |       |       |---/Mailer.php
     |       |--/Middleware
     |       |       |---/Middleware.php
     |       |--/Models
     |       |       |---/Model.php
     |       |--/Validation
     |       |       |---/Validator.php
     |       |
     |       |-------routes.php
     |
     |---Booting
     |      |---app.php
     |
     |---Vendor
     |      |---composer
     |      |---container-interop
     |      |---doctrine
     |      |---illuminate
     |      |---nesbot
     |      |---nikic
     |      |---phpmailer
     |      |---pimple
     |      |---psr
     |      |---respect
     |      |---slim
     |      |---symfony
     |      |---twig
     |      |-----autoload.php
     |-----index.php
     |-----.htaccess

Test Api

Your can see on routes.php for more links or api links

link test APIs data
   1.                         base_url/example
   2. all data   -      base_url/example/api/v1/datas
   3. data with id -      base_url/example/api/v1/data/{id}
   4. add data -           base_url/example/api/v1/create/data
        you need name or other of "data" as a parameter
   5. Update data -           base_url/example/api/v1/update/data
        update data you need "data" and "id" as a parameter
   6. Delete data -           base_url/example/api/v1/delete/data/{id}

link test APIs Auth (Singin & Singup)
    1. singup -             baseu_url/auth/singup
            need  "full_name", "phone", "username", "emai", "password" as a parameter
    2. singin -             base_url/auth/singin
            need "email", "password" as a parameter
    3. change password -    base_url/auth/password/change
            need "old password" dan "new Password" as a parameter
    4. reset password - base_url/auth/password/reset
            nedd  "email" as a parameter and then you will get an email to change your password

auth account default admin
    1. email    :   mail@asmith.my.id
    2. password :   password
auth account default member
    1. email    :   sidia@asmith.my.id
    2. password :   password

example implementation on android app :

About

Rest APIs with SLIM 3


Languages

Language:PHP 88.8%Language:HTML 9.1%Language:CSS 2.0%