How to Allow Admin Users to Edit Formulas for Pricing Computation in Laravel/JS? [closed]

Please guide me to execute the following, I’m using JavaScript with Laravel:

  1. An admin role can CRUD a formula list that would appear in a dropdown option, for instance:

    • They can select from a list of products and its price would be retrieved.

    • The user can edit the formula by specifying whether
      (Item Price) - (input) + (input) % (input)
      etc.

  2. The formulas will be stored in dropdown that would affect the calculation of another form for final computation.

For instance in a sales form:

<h1>Sales Pricing Form</h1>

<form id="pricingForm">
    <!-- Dropdown for Formula Selection -->

    <label for="formulaDropdown">Select Formula</label>
    <select id="formulaDropdown" name="formula">
        <option value="avgFormula">Average Formula</option>
        <option value="saleFormula">Sale Formula</option>
    </select>
    <br><br>

    <!-- Input Fields -->
    <label for="quantity">Quantity</label>
    <input type="number" id="quantity" name="quantity" required>
    <br><br>

    <label for="totalAmount">Total Amount</label>
    <input type="number" id="totalAmount" name="totalAmount" required readonly>
    <br><br>

    <button type="submit">Submit</button>
</form>

The overall goal is when user clicks on a specific formula, it would affect the computation of the total amount.

I’m just currently brainstorming on how to best solve this problem. Thanks a lot!