{"id":28940590,"url":"https://github.com/kinoba/kinobacouponbundle","last_synced_at":"2026-02-27T07:43:37.722Z","repository":{"id":57006852,"uuid":"152558130","full_name":"Kinoba/KinobaCouponBundle","owner":"Kinoba","description":"Coupon Codes Generator for Symfony","archived":false,"fork":false,"pushed_at":"2024-07-15T23:56:46.000Z","size":27,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-22T15:14:23.030Z","etag":null,"topics":["bundle","coupons","php","promo-codes","symfony"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kinoba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-10-11T08:33:14.000Z","updated_at":"2023-04-17T11:46:58.000Z","dependencies_parsed_at":"2025-06-23T01:42:08.549Z","dependency_job_id":null,"html_url":"https://github.com/Kinoba/KinobaCouponBundle","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kinoba/KinobaCouponBundle","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kinoba%2FKinobaCouponBundle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kinoba%2FKinobaCouponBundle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kinoba%2FKinobaCouponBundle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kinoba%2FKinobaCouponBundle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kinoba","download_url":"https://codeload.github.com/Kinoba/KinobaCouponBundle/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kinoba%2FKinobaCouponBundle/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261396817,"owners_count":23152455,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bundle","coupons","php","promo-codes","symfony"],"created_at":"2025-06-23T01:41:56.510Z","updated_at":"2026-02-27T07:43:37.717Z","avatar_url":"https://github.com/Kinoba.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"This bundle is under construction, do not use in production\n\nInstallation\n============\n\nApplications that use Symfony Flex\n----------------------------------\n\nOpen a command console, enter your project directory and execute:\n\n```console\n$ composer require kinoba/coupon-bundle\n```\n\nApplications that don't use Symfony Flex\n----------------------------------------\n\n### Step 1: Download the Bundle\n\nOpen a command console, enter your project directory and execute the\nfollowing command to download the latest stable version of this bundle:\n\n```console\n$ composer require kinoba/coupon-bundle\n```\n\nThis command requires you to have Composer installed globally, as explained\nin the [installation chapter](https://getcomposer.org/doc/00-intro.md)\nof the Composer documentation.\n\n### Step 2: Enable the Bundle\n\nThen, enable the bundle by adding it to the list of registered bundles\nin the `app/AppKernel.php` file of your project:\n\n```php\n\u003c?php\n// app/AppKernel.php\n\n// ...\nclass AppKernel extends Kernel\n{\n    public function registerBundles()\n    {\n        $bundles = array(\n            // ...\n            new Kinoba\\CouponBundle\\KinobaCouponBundle(),\n            // ...\n        );\n    }\n}\n```\n\n### Step 3: Configure your app\n\nYou have to add 2 entites : Coupon and GeneratedCoupon to your project\n```php\nnamespace App\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Kinoba\\CouponBundle\\Model\\Coupon as BaseCoupon;\n\n/**\n * @ORM\\Table(name=\"coupons\")\n * @ORM\\Entity\n */\nclass Coupon extends BaseCoupon\n{\n}\n```\n\n```php\nnamespace App\\Entity;\n\nuse Doctrine\\ORM\\Mapping as ORM;\nuse Kinoba\\CouponBundle\\Model\\GeneratedCoupon as BaseGeneratedCoupon;\n\n/**\n * @ORM\\Table(name=\"generated_coupons\")\n * @ORM\\Entity\n */\nclass GeneratedCoupon extends BaseGeneratedCoupon\n{\n}\n\n```\n\n\nYou need to map your entities with our interfaces.\nIn `doctrine.yaml` or `config.yml`, add :\n```yaml\ndoctrine:\n    orm:\n        resolve_target_entities:\n            Kinoba\\CouponBundle\\Model\\CouponUserInterface: App\\Entity\\User\n            Kinoba\\CouponBundle\\Model\\BillableInterface: App\\Entity\\Offer\n```\n\nYou could add a new file `kinoba_coupon.yaml` with 3 parameters in it\n```yaml\nkinoba_coupon:\n    default_mask: KIN*****\n    characters: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ\n    coupon_class: App\\Entity\\Coupon\n    generated_coupon_class: App\\Entity\\GeneratedCoupon\n```\n\n### Step 4: Usage\n\nCreate a new code in the database thank to `CouponProvider`:\n`create($amount = 1, $type = Coupon::TYPE_FIXED, $maxNumber = 1, $expiredAt = null, $mask = null)`\n\n`$type`: TYPE_FIXED for currency discount or TYPE_PERCENTAGE for %\n\n`$maxNumber`: max number of generated coupons after the coupon became invalid\n\n`$expiredAt`: End of validity for a coupon\n\n`$mask`: Create a coupon with a new mask (not defaultMask)\n\n---\n\nIf you want to check if a code exists and is usable:\n`check($code)`\n\nReturns `Coupon` object if valid or `false` if not\n\n---\n\nIf you want to check if user tries to use a code for second time you can call `isSecondUsageAttempt` and pass\nCoupon object and CouponUserInterface as an argument.\nReturns a boolean value\n\n---\n\nApply a code:\n`apply($code, $user, $bill = null)`\n\n`$bill`: if you want to connect a generated coupon with a payment/bill/offer\n\nApply will check if the code is usable\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinoba%2Fkinobacouponbundle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkinoba%2Fkinobacouponbundle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinoba%2Fkinobacouponbundle/lists"}