gemy/mygift-api

using for mygift-api

1.0.0 2023-10-25 08:57 UTC

This package is auto-updated.

Last update: 2024-10-25 10:59:18 UTC


README

My gift logo

Build Status Total Downloads Latest Stable Version License

app link on google play app link on apple store

My Gift

My Gift is an application to buy discount coupons

Installation

You can install the package via composer:

composer require gemy/mygift-api

setup Database

to setup my gift setting:

php artisan my-gift:setup

setup Slug

to save your slug on my gift:

php artisan my-gift:slug

The status codes

These are the codes that will be returned to you in the event of success or failure:

This is the code when the status is 200

if "type" = "per" It means that it is a percentage, and when it is with "value" it means that it is just a value

my gift response

The code

use it as a trait

use Gemy\MygiftApi\App\MyGiftApi;

class HomeController extends Controller
{
    use MyGiftApi;

    public function checkIfCodeExists()
    {
        $response = $this->checkIfCodeExists('code', 'slug');
        
        //put your code here
    }
    
    public function useCoupon()
    {
        $response = $this->useCoupon('code', 'slug','your order id','The discount value after the calculation');
        
        //put your code here
    }
}