How to debug in Filament
Hi guys need a little help ,
I have a custom resource to select which subjects are going to be taught in a class
So i created this checkbox field which loads options depending on which pattern/syllabus was selected
But apparently it is not saving the subjects in the pivot table ! I cannot get over it, please send boys.
Also my model relations are like
StudentClass Model
6 Replies
If it's not saving I susepct the fillabale maybe empty. But you would tend to debug as normal. You can use Telescope to monitor all requests too and see what data was received to what was saved and so on
I prefer buggregator with ray, it's really good combo with lots of features, you can even use xhprof to generate flamegraph and call graph and see it in buggregator.
Are you using a custom page? Or the default resource pages?
a default resource page
@toeknee @Zamion101 @Dennis Koch , I think i solved it by removing the line ! Still I really appriciate your help. It is said that a small silly bug is the most dangerous one Haha.
But if any one is going to read in future and wanna debug here are copuple of vanilla tips :
1. Turn on QueryLogger and print what all queries was fired to check if its the case -> any query tried to run and failed so you dont have updated data
2. Ofc USe get state on create or before save methods to print your state data -> this will let you know if the data you filled in wrt to your input elements are there in state data or not
3. IF in 1 you didnt got any insert query , in 2 you got some states , its most likely me case aka dehydrate is fasle
Oh yeah. Didn’t realise that one. 🙈
My debugging tip: I usually go through the code with Xdebug
Thanks for tip , but for me it is like taking a deep in new ocean :p will try it out once i get time xoxo