Laravel EnsoLaravel Enso
Guide
Back End
Front End
GitHub
Guide
Back End
Front End
GitHub
  • Back End

    • Action Logger
    • Addresses
    • Algolia
    • Algolia Webshop
    • API
    • Audits
    • Avatars
    • Cache Chain
    • Calendar
    • Cargo Partner
    • Categories
    • Charts
    • CI/CD
    • Cli
    • CNP Validator
    • Comments
    • Commercial
    • Companies
    • Core
    • Countries
    • Currencies
    • Data Export
    • Data Import
    • Discounts
    • Documents
    • Dynamic Methods
    • EAV
    • Emag
    • Enums
    • Excel
    • Facebook
    • Files
    • Filters
    • Financials
    • Forms
    • Frisbo
    • Google
    • Helpers
    • Holidays
    • How-to
    • Image Transformer
    • Impersonate
    • Interactions
    • Inventory
    • IO
    • Localisation
    • Lockable Models
    • Logs
    • Measurement Units
    • Meili Search
    • Meili Search Webshop
    • Menus
    • Migrator
    • Monitored Emails
    • Notifications
    • Packaging Units
    • PDF
    • People
    • Permissions
    • Product Eav
    • Product Lots
    • Products
    • Questionnaires
    • Rememberable
    • Roles
    • Sale Channels
    • Searchable
    • Select
    • Sentry
    • Services
    • Smart Bill
    • Sms Advert
    • Stripe
    • Tables
    • Tasks
    • Teams
    • Ticketing
    • Track Who
    • Tutorials
    • Typesense
    • Typesense Webshop
    • Unit Conversion
    • Upgrade
    • UPS
    • User Groups
    • Users
    • Versions
    • Virtual Call Center
    • Vouchers
    • Webshop
    • Webshop Commercial

Discounts

LicenseStablePHPIssuesMerge Requests

Description

Discounts adds commercial discount management to Enso.

The package covers both client and supplier discounts, split into three discount families: general discounts, product discounts, and service discounts. Each family exposes its own CRUD and table endpoints, while the package also provides a small helper trait for filtering discounts by company or person clients.

It is intended for private Enso deployments that manage commercial pricing rules across products and services.

Installation

This is a proprietary package distributed through the private Enso registry.

Run the package migrations:

php artisan migrate

The package exposes only the backend/API layer. Frontend integration is handled by the companion @enso-ui/discounts package.

Features

  • Client discount management for general, product, and service discounts.
  • Supplier discount management for general, product, and service discounts.
  • Datatable endpoints, Excel export endpoints, and selector endpoints for every discount family.
  • DiscountTypes enum for classifying discount behavior.
  • HasClient trait for filtering discounts by company or person client.

Usage

Use the HasClient trait on discount-like queries that need to target a company or a person:

use LaravelEnso\Discounts\Traits\HasClient;

class ClientProductDiscount extends Model
{
    use HasClient;
}

The package routes are grouped by target audience and discount type:

  • discounts.clients.generals.*
  • discounts.clients.products.*
  • discounts.clients.services.*
  • discounts.suppliers.generals.*
  • discounts.suppliers.products.*
  • discounts.suppliers.services.*

API

HTTP routes

Client discounts:

  • api/discounts/clients/generals/*
  • api/discounts/clients/products/*
  • api/discounts/clients/services/*

Supplier discounts:

  • api/discounts/suppliers/generals/*
  • api/discounts/suppliers/products/*
  • api/discounts/suppliers/services/*

Each family exposes:

  • create
  • store
  • edit
  • update
  • destroy
  • initTable
  • tableData
  • exportExcel
  • options

Depends On

Required Enso packages:

  • laravel-enso/core ↗
  • laravel-enso/dynamic-methods ↗
  • laravel-enso/forms ↗
  • laravel-enso/migrator ↗
  • laravel-enso/products ↗
  • laravel-enso/services ↗
  • laravel-enso/tables ↗

Runtime companion packages:

  • laravel-enso/companies ↗
  • laravel-enso/people ↗

Companion frontend package:

  • @enso-ui/discounts ↗
Edit this page on GitHub
Last Updated: 4/20/2026, 6:07:11 PM
Prev
Data Import
Next
Documents