Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Saneesh's avatar

Promotion discount syatem in Laravel

Hi all,

I want to implement a promotion discount system in Laravel.

Campaigns

  • Promotions
    • limited(corporates)
      • coupons
    • individual(user assigned)
      • coupons
    • general
      • coupons

User may get discount on order, product, cart etc. Conditions like "order_total > 200" or product_name === 'Kitkat' Discounts like %off, flat discount, shipping free, %off on nth quantity, Buy X get X free etc. (In future new discounts also add.)

How do I achitecture it? What are the Laravel concepts I need to use to achieve it? event-listner concept is useful here if we consider the new discounts?

I'm using Laravel5.5 + MongoDB.

Regards, Saneesh.

0 likes
1 reply
topvillas's avatar

Store the discount details as json (you're using Mongo so not a biggie).

Create a class, implementing an discount interface, for each type of discount.

Please or to participate in this conversation.