Spârky
Mutate pivot data on parent creation
Hello!
I have 2 entities called "Contact" and "Message". I added a pivot table between them using BelongsToMany. I also added pivot data with
->withPivot(['confirmation_code', 'confirmation_date', 'status'])
.
On my form, I only want to create a Message with some fields and a select in which I choose the Contacts (receivers).
The pivot data must not be modified by users, so I want to mutate the pivot data to generate a different 4-digit code for each Contact and initialize the status.
How can I achieve this?7 replies
Is it possible to prevent user to put end time earlier than start time with TimePickers ?
Hello !
I'm trying to make a form to show working hours but I can't find a way to prevent the user to set a endTime earlier than the startTime. Any ideas?
I tried with reactive() and $get but the behaviour wasn't working as intended, could be my bad tho.
3 replies
Make a graph to count records by month and year
Hi everyone,
I have a
Has anyone an idea how to achieve that? Thanks!
Device
model with a installation_date
attribute.
I'd like to build a line chart in a widget which shows how many devices have been installed per month.
Some months will have 0 installations but they still have to be displayed in the graph. Also, I'd like to show the year on the months-axis (like 03-2023).Has anyone an idea how to achieve that? Thanks!
3 replies