Anish
How to close action confirmation modal after form validate fails?
I found a way to close the modal window - after the confirmation button is clicked. Here is my action
This seems to work for me, if it passes validation, goes through the action. If it fails validation, the modal window is closed and shows validation window.
Probably, naming could have been better! I guess that I should call it confirmedAction or something similar. I can put it in a trait and use it any place.
9 replies
DateConstraint
Thanks. But that's not using the DateConstraint. This is creating each filter separately. Then we can only use the "and" operations. I find the query builder is much more flexible. Of course, if I am unable to find a solution I will probably go back to a similar solution.
5 replies
Delete exported file
After checking the documentation, I found that there is a model
which holds the information about the export. One can define a hasMany relation on the User model to get the exports done by the User.
What I now need if there is any event that is dispatched when one clears the notifications. Then I can write a listener which will delete the file and also the corresponding database entry. I think this may be a Laravel Event, so I need to dig up the details on clearing database notifications.
9 replies
CSS & JS
I tried it out. I uploaded the global css files to S3 and then loaded via AppServiceProvider, as mentioned in the documentation. But it is loading both css, local as well as from s3. I now need to find a solution to stop it from loading it from the local server. Any suggestions?
7 replies
How can I render a PDF using a Livewire component that implements HasInfolists?
This is what works for me. I am developing a student application system, where student fill up the application, make payment for application fee and finally submit the application form. Once an application is submitted, we need to generate the pdf version of the application, save it to the disk and send it by email as attachment. So that is the context.
I made liveware component - this is only to generate the application pdf (not for showing to the student)
I am using Spatie's PDF facade. This seems to work quite well with the CSS. The blade file is at this moment
I can use tinker to open a session and use
I have not yet taken the CSS, but this gets the data and creates a PDF file with correct data. This should be good enough for me. I hope that this helps.
6 replies
CSS & JS
Thanks for the help. If I understand correctly once I have compiled these css and js files for each panel, I should name it suitably, say app-{panel}.css and app-{panel}.js and then copy them to my external server (to a s3 server actually) and then I register them in the AppServiceProvider. But then won't all of them would be loaded when I load different panels? The color themes are different for different panels, how would they work? I suppose global css / js can be loaded via this, but I still would need a way to load panel specific css /js for different panel. Anyway I will try it out.
7 replies
Terms and Policy
In Laravel Jetstream, there is a feature called Terms and privacy policy. You have to create two markdown files and name them as policy.md and terms.md and keep them in your resources directory under markdown sub-directory and enable the feature in the Jetstream config file by uncommenting the corresponding line. Once it is done, Laravel will take the user after registration and email verification to that terms and policy page. Unless the user agrees to the terms it will not let the user continue to the dashboard. The email verification is already available in Filament. Is there a way to do the terms and policy page also?
4 replies
Middleware in Panel Route
Found a hacky solution - don't like it but it works.
I created a middleware, which I name as StudentPanelCheckMiddleware. In that I run a try catch block. In the try block -
You will also need to add it to the list of middlewares in the panel.
4 replies
Registration Event
The user created event will have the data of the user. But I want to pass extra data which may not be part of the user. Let me give context in my case: I am working on the application portal for students. There are 3 groups of students and the application forms are very different for different groups. So I am planning to put an extra field in the registration form which will identify the group. After registration, depending on the group, I want to create the model in the corresponding student in that group. But the user will not have information about the group. So if there is an event triggered with this data, a listener can act on it
7 replies