vendredi 5 juillet 2019

Laravel Voyager - How to automatically get column value from previous relationship

I am developing an appointment system in Laravel Voyager, where an appointment can have many services, and a service has fixed service duration. How can I select a column value automatically from previous relationship value?

Here I want the column selected the correct Duration based on the Service selected from the previous dropdown value.

I tried to setup a relationship with a Appointment Has One Service, referencing the column ID from Service and displaying and storing the column value Duration.

In the admin panel, I selected

Appointment Has One Services with Model App\Service displaying Duration and storing Duration

Voyager Relationship

I expect the field Duration be saved as 60, as the Services database has 60 minutes duration for Eyebrows service.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire