In my current L5.3 application, I need to set a booking fee based on the value of the price field. If the price is > 3500 then the booking fee will be 550, otherwise 330.
An admin can change the booking fee manually, normal users don't have access to edit the booking fee field.
An admin can set the booking fee manually, and a user can still edit the booking afterwards, so we don't want to re-compute the booking fees based on the price field.
The price can be set to 0, or the is_free option field could be true. If the ticket is free there are no booking fees involved.
My options so far are:
Handle it from the controller, which I don't want to since it's a large form. (just want to use request->all()) when saving.
Use the setBookingFeeAttribute() on my model, but it feels dirty as I will need to access the data from my request (request()->price and request()->is_free).
Override the all() method from the Form Request, which seems half decent but I'm not 100% happy with this solution.
Have I missed anything that could handle this use case nicely?