Anish
Anish
FFilament
Created by Anish on 6/8/2024 in #❓┊help
CSV Edit
Has anyone implemented a CSV editing form? In my application, users upload CSV files (not big ones - maximum 250 rows) and they are imported into the database after validation. Often there are small mistakes in the data which fail validation. Then they have to delete the file, correct the mistake and re-upload and try to import again. If they could update in place and retry, a lot of problems will be solved for me. So I wanted to check if anyone has already implemented something similar. In my mind, the layout might be like the keyvalue component, except that each row may have more entries. Or perhaps a repeater component form without the extra spaces. Thanks to anyone for any help or suggestions.
2 replies
FFilament
Created by Anish on 3/5/2024 in #❓┊help
DateConstraint : Nullable Issue
The Date Constraint is not working properly with nullable value.
DateConstraint::make('application_submitted_at')->nullable()
DateConstraint::make('application_submitted_at')->nullable()
This provides the two more extra options : 'Is Blank' and 'Is Filled'. If I understand correctly, 'Is Blank' option is for null values & Is Filled is for non-null values. When I try to apply 'Is Blank' - the filter works correctly to identify the null values. But when I try is 'Is Filled' - the filter does not work. I logged the query and saw the query being run :
select count(*) as aggregate from `applications` where ((`applications`.`application_submitted_at` is not null and not `applications`.`application_submitted_at` = ?))
select count(*) as aggregate from `applications` where ((`applications`.`application_submitted_at` is not null and not `applications`.`application_submitted_at` = ?))
The bindings are
[]
[]
I check that the bindings value is string (blank value, i.e., ''). I tried to run this with my mysql server (frontend phpmyadmin), I tried with ? replaced by '', i.e.,
select count(*) as aggregate from `applications` where ((`applications`.`application_submitted_at` is not null and not `applications`.`application_submitted_at` = ''))
select count(*) as aggregate from `applications` where ((`applications`.`application_submitted_at` is not null and not `applications`.`application_submitted_at` = ''))
and it throws an error
#1525 - Incorrect DATETIME value: ''
#1525 - Incorrect DATETIME value: ''
So, I tried to run the query without the last part, i.e.,
select count(*) as aggregate from `applications` where ((`applications`.`application_submitted_at` is not null ))
select count(*) as aggregate from `applications` where ((`applications`.`application_submitted_at` is not null ))
and it runs correctly. I guess the nullable() method is trying to get either NULL values or blank strings. However, for DATETIME values it can't take a blank string value. Probably I will need to write a new Operator to overcome this. Any help is most appreciated.
3 replies
FFilament
Created by Anish on 3/4/2024 in #❓┊help
DateConstraint
I am trying to build a filter using QueryBuilder. I am trying to use a DateConstraint in which I want to filter by Date time.
DateConstraint::make('application_submitted_at')->nullable(),
DateConstraint::make('application_submitted_at')->nullable(),
It is cast as datetime in the model. But the option for setting the filter value, provides only the date option, no time option is available. Further it seems that the form uses the native datepicker. Is there a way to set both date & time and the javascript based datepicker. Thanks in advance for any help.
5 replies
FFilament
Created by Anish on 2/19/2024 in #❓┊help
Delete exported file
Is there a way to remove the exported files and the relevant database entry for an exporter?
9 replies
FFilament
Created by Anish on 2/5/2024 in #❓┊help
CSS & JS
I have 3 panels - one for guest, one admin and one for students. All three have their own themes. I have run npm run build and build the assets. In deployment, I want to take out the CSS and JS file to a different server. But the next step is not clear to me. Any advice?
7 replies
FFilament
Created by Anish on 2/2/2024 in #❓┊help
Infolist to PDF
I am looking for a way to convert an infolist to a pdf. Spatie/Pdf works well for html as well as blade to get a well formatted pdf file. However I am stuck in trying to get infolist to pdf. Can we get the html from the infolist? If so, how? Or do I need to create a view where I put something like {{ $infolistToBeRendered }} ? Unable to proceed. Any pointers ? Thanks in advance.
2 replies
FFilament
Created by Anish on 2/1/2024 in #❓┊help
Theme Customization
I see that I can customize theme per panel by adding a theme,css in resources/css/filament/{panel} directory. I have multiple panels and I want some customization to all panels (some global configurations) and of course some to each individual panels. Is there a way to put the global configurations which will be applied to all of the panels? Thanks in advance for any help.
2 replies
FFilament
Created by Anish on 1/30/2024 in #❓┊help
Modal Open before validation
I have to extend the registration for panel to include Terms of Use & Policy. So, I am extending the vendor Register model by just changing the getRegisterFormAction.
Here is the code
public function getRegisterFormAction(): Action
{
return Action::make('register')
->requiresConfirmation()
->steps(Registration::getModalSteps())
->action(fn () => $this->register())
//->submit('register')
;
}
public function getRegisterFormAction(): Action
{
return Action::make('register')
->requiresConfirmation()
->steps(Registration::getModalSteps())
->action(fn () => $this->register())
//->submit('register')
;
}
I observed that if I don't add the action part, the modal is not triggered. I couldn't find any documentation. Though it is easy to overcome, what I see that the modal is triggered before the registration form is validated. Is this the default behaviour? Is there a way to first have the validation and then trigger the modal? Also the modal upon submit does not seem to close automatically. So if there are validation errors, it looks as though nothing has happened. Once you close the modal, then you find the errors. Again is the default behaviour? At least I hope not. Also, is there a way to close the modal when confirmation button (in this case Wizard Step) are completed? Thanks in advance for any help.
3 replies
FFilament
Created by Anish on 1/29/2024 in #❓┊help
Terms and Policy
Does anyone know how to implement a jetstream like terms and privacy policy?
4 replies
FFilament
Created by Anish on 1/28/2024 in #❓┊help
Disable sidebar
Is there a way to remove the sidebar only on a single custom page? I have a custom page which I want to use like a splash page. After email is verified, I want to forward it that page. But it is not a simple page but more a full page - has some data, and possibly a form (we are debating about the form!). But on a splash page I don't want the sidebar, the top bar is OK. So only on that page, I want to remove the sidebar. Any suggestion?
3 replies
FFilament
Created by Anish on 1/27/2024 in #❓┊help
Middleware in Panel Route
I have a panel with a couple of resources and a couple of custom pages. I want to apply middleware in one of the custom pages, not on all of them. To give some context, I am developing a student application portal and there is a form submission page. But before form submission, I want to run checks (date not over, payment completed etc.) that the form can be submitted. If those checks are not satisfied, the user should not be able to access the page. Also in one of the resources, I want to restrict access to a view page. I have a policy which restricts the access to the view page. However that returns unauthorised access, but I don't want to show such a page, instead I will like to send the user to the dashboard with some notifications. For regular (non livewire) pages, middleware with can and redirect will do the job. My question is how do I achieve this for a resource page? Thanks for any help in advance.
4 replies
FFilament
Created by Anish on 1/23/2024 in #❓┊help
Disable Submit Button
I have a custom page with a simple form having one single checkbox button. I want to disable the submit button if the checkbox is not checked /accepted. Is there any easy way to achieve it? Thanks in advance for any help.
5 replies
FFilament
Created by Anish on 1/21/2024 in #❓┊help
Registration Event
When a registration happens in a particular panel, is an event triggered? If so, what is the event and what data is passed to the event? If not, I will suggest that an event, say Registered, with the following data
[
'panel' => $panel,
'user' => $user,
'data' => ...
]
[
'panel' => $panel,
'user' => $user,
'data' => ...
]
may be triggered. In the data array, other custom fields (not required for the user model) may be included. This will be very useful in customizing any post registration actions that need to be carried out. A listener may take suitable action for customisation. Let me know what any of you think.
7 replies
FFilament
Created by Anish on 1/20/2024 in #❓┊help
Description List - Infolist
Is there someway we can make Infolist entry to have a similar view as that in Tailwindcss UI page (one of free components) https://tailwindui.com/components/application-ui/data-display/description-lists
2 replies
FFilament
Created by Anish on 1/18/2024 in #❓┊help
Separator
Is there a way to put a separator line in an infolist section. I don't want to make a separate section, but within a section just separate two groups by a horizontal line, say.
Thanks for any help.
4 replies
FFilament
Created by Anish on 1/16/2024 in #❓┊help
Array Order
I have an array of this kind

[
'Option 1',
'Option 2',
'Option 3',
]

[
'Option 1',
'Option 2',
'Option 3',
]
I need a form element in which the user may re-order this array to achieve something like

[
'Option 2',
'Option 1',
'Option 3',
]

[
'Option 2',
'Option 1',
'Option 3',
]
but can't delete / add / update any option. I am trying with Repeater, but the results are not very good.
Thanks in advance for any suggestions / pointers.
8 replies
FFilament
Created by Anish on 1/13/2024 in #❓┊help
Infolist : rendered html
I have a view page in which I have an infolist. Essentially that is an application form submitted by an applicant. I want to send a pdf exported version to the applicant by email.
Generally I use Browsershot package by Spatie for exporting html / blade to pdf. Therefore I need the rendered html from the infolist. Is there a way to capture the html string rendered in an infolist to a variable? Many thanks in advance for any pointers.
3 replies
FFilament
Created by Anish on 1/9/2024 in #❓┊help
Panel Registration
I am trying to develop a student application system in which I have two panels - one for applicants and other admin. The students should be able to register and then fill up the application form and pay for the application. However, I want to open registration from a particular date and close it on another date. One thing I have thought is to create a middleware, say RegistrationOpenMiddleware, which will redirect all requests to the register route to the home page outside of the duration of registration. I am not sure that it is the best way to achieve this, any suggestions will be of great help.
2 replies
FFilament
Created by Anish on 12/11/2023 in #❓┊help
Edit Page URL customization
I want to customize the url in the edit page of a resource to use slug in place id. I don't want to change in the model. I am using :
'edit' => Pages\EditAuthor::route('/{record:slug}/edit'),
'edit' => Pages\EditAuthor::route('/{record:slug}/edit'),
But this does not seem to work. Thanks in advance for any help.
7 replies
FFilament
Created by Anish on 11/9/2023 in #❓┊help
Automatic Logout
I have a strange issue with my first project in V3. I made a basic User resource. When I update myself, say name, I get automatically logged out. But when I update, another user (given myself admin role and set up the policy that admin can update all users), it works as expected.
Thanks in advance for any help.
11 replies