TokonYa is backed for faster development. It means we not use bloatware code.
- We using Oauth 2.0 for authorization using Passport.
- We choice UUID v4 instead Autoincrement model.
- REST API only
- Pagination
- Eloquent API Resources
- SoftDeletes Model
- Standart API Response
- Customer login
- Customer registration
- Customer verify (by email)
- Customer can update profile (avatar, address, gender)
- Merchant login
- Merchant registration
- Merchant verify (by email)
- Merchant create product
php composer2.phar install
Create some database
cp .env.example .env
Setup your database environment
php artisan passport:keys --force
php artisan migrate:fresh --seed
curl -X POST \
http://localhost:8000/api/merchant/login \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"username" : "odenktools@gmail.com",
"password" : "hey1234",
"client_id" : 3,
"client_secret" : "imJrfnJAHPtCre1E4SriBxLZEjDfkFraKLB0aJMi",
"grant_type" : "password"
}'
curl -X POST \
http://localhost:8000/api/merchant/login \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"username" : "balabala@gmail.com",
"password" : "hey1234",
"client_id" : 3,
"client_secret" : "imJrfnJAHPtCre1E4SriBxLZEjDfkFraKLB0aJMi",
"grant_type" : "password"
}'
curl -X POST \
http://localhost:8000/api/merchant/login \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"username" : "iku@gmail.com",
"password" : "hey1234",
"client_id" : 3,
"client_secret" : "imJrfnJAHPtCre1E4SriBxLZEjDfkFraKLB0aJMi",
"grant_type" : "password"
}'
curl -X POST \
http://localhost:8000/api/merchant/login \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"username" : "alexandria@gmail.com",
"password" : "hey1234",
"client_id" : 4,
"client_secret" : "imJrfnJAHPtCre1E4SriBxLZfjDfkFraKLB0aJMi",
"grant_type" : "password"
}'
curl -X POST \
http://localhost:8000/api/merchant/login \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"username" : "johndoe@gmail.com",
"password" : "hey1234",
"client_id" : 4,
"client_secret" : "imJrfnJAHPtCre1E4SriBxLZfjDfkFraKLB0aJMi",
"grant_type" : "password"
}'
curl -X GET \
http://localhost:8000/api/customer/profile \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {{YOUR_ACCESS_TOKEN}}' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache'
curl -X POST \
http://localhost:8000/api/customer/update \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {{YOUR_ACCESS_TOKEN}}' \
-H 'content-type: multipart/form-data' \
-H 'cache-control: no-cache' \
-F 'customer_address=Your address' \
-F 'gender=male' \
-F 'image=@/home/odenktools/03b1c1afcc4a00f2be.png'
curl -X POST \
http://localhost:8000/api/customer/register-merchant \
-H 'Accept: application/json' \
-H 'Authorization: Bearer {{YOUR_ACCESS_TOKEN}}' \
-H 'Content-Type: application/json' \
-H 'cache-control: no-cache' \
-d '{
"merchant_name": "Coffe Goodds",
"merchant_address": "Chicago, IL 60605"
}'
composer require --dev barryvdh/laravel-ide-helper
php artisan ide-helper:generate
php artisan clear-compiled
php artisan ide-helper:generate
php artisan clear-compiled
MIT License
Copyright (c) 2021 odenktools
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.