Oxygarum
Access JSON and display in a table
Hey, probably I am overlooking something really obvious.
I have a table and in that want to access a JSON that is stored in a database column in another model.
When trying to debug with log::info it is displaying me the info correctly, but I am not sure how to let ->query use the data in the JSON
My code for accessing the JSON looks like this:
For the log::info I receive back my test entry of
"[{"shift_id":1,"shift_type":"TestType","shift_description":"TestDescription","shift_duration":25,"shift_date":"2024-11-27","shift_supervisor":["John Doe"]}]"
3 replies
Limit display of entries in table
Hey,
I know there is probably something overly easy I am overlooking, but I can not figure it out...
I have made a widget displaying a table, but now want to only show the 5 most recent records. How can this be done? I first thought about limit(), but its not working.
Thanks 🙂
3 replies
Problem with creating query to show differences in values from variables and sort them
Hey Hey,
I have a database that is getting input through a DeliveryLog resource form and so forth. In that employees need to input their deliveries handled within a shift. For simplicity I just called them deliveriesatstartofshift and deliveriesatendofshift. That is all working perfectly.
Now I created a new Resource, Model and so forth in which I want to use a query to display the employees that made the most deliveries within the last seven days. For this I would want to take the difference between deliveriesatstartofshift and deliveriesatendofshift for all shifts the employees did in that time period. Employees can make multiple shifts of course within the last days so those differences would need to get added up.
I worked for a while on it already, but am always running into the error "Cannot use "::class" on value of type null".
This is what I made so far for the query:
Hopefully I explained it well enough 😄
5 replies