Validate and caculate product variations shopping cart

I’m trying to validate and calculate the product variations on the shopping cart. On the frontend side the user can select/add product variations. For example extra Cheddar or mayonnaise. The variations have different prices that need to be calculated and shown on the shopping cart.

Frontend user input

When a variation is selected and I validate it at the back end, the correct variation is shown on the shopping cart (see image below).

Shopping cart with variations

Only the price for the different variations are not calculated on the totals.

When I store the price directly on the select value and do not validate it on the controller it’s calculated correctly. But then it’s possible for the user to change the price with the browser console.

Controller:

public function addToCart($id, Request $request)
{
    $product = Product::findOrFail($id);

    // Get user input from front-end
    $option = $this->option;
    $options = $this->options;

    // If option is required
    // Check if option present in model
    $option = Item::where('id', $option)->get()->toArray();

    // If multiple options possible
    // Check if options present in model
    $options = Item::where('id', $options)->get()->toArray();

    if ($product->has_options === "true") {
        if($option === null) {
            $finalOptions = $options;
        } else {
            $finalOptions = array_merge($options, $option);
        }
    } else {
        $option = $this->option;
        $finalOptions = null;
    }

    // If product has options = true calculate product variations price
    if($finalOptions) {
        $total = ($product->discount_price != '' ? $product->discount_price : $product->total_price)
            + array_sum(($finalOptions));
    } else {
        $total = ($product->discount_price != '' ? $product->discount_price : $product->total_price);
    }

    Cart::add(array(
        'id' => $product->id,
        'name' => $product->title,
        'price' => $total,
        'qty' => 1,
        'options' => array(
            $finalOptions
        ),
        'associatedModel' => $product
    ));

    $this->dispatchBrowserEvent('closeModal');
    $this->emit('cart_updated');

    foreach($this->options as &$recipient) {
        $recipient = false;
    }

    $this->option=null;
}

Blade

<select wire:model.defer="option.{{ $extra->id }}" wire:key="option-select-{{ $extra->id }}" class="form-select" required>
    @foreach($items as $item)
        @if($extra->items->pluck('id')->contains($item->id))
            <option wire:key="item--{{ $item->id }}" name="option" value="{{ $item->id }}">
                {{ $item->title }} (+€ {{ number_format((float)Str::words($item->price),2, ',', '') }})
            </option>
        @endif
    @endforeach
</select>

Anything that I’m missing?