mohdaftab
Sushi to dynamically load data from API using search keyword
Hello,
I am using Sushi to load a data into a table with API data using a search keyword.
But I am missing something here as I am not able to load the data from API after the search but if I provide the search term initially then it loads the proper data to the table.
Please check my code and help me fix this, thank you so much.
This is my custom page code, removed the imports due to limitations.
Thank you
5 replies
Replication causes 500 internal server error
Hello,
I am using Replication with filament-fabricator and was facing this issue on production server whenever we created a replica page I made it redirect to the edit page but it always gave me 500 server error because the newly created page id was not found in routes somehow.
I figured I always had to run php artisan optimize:clear command to make that page work so I created an observer to run this command everytime the page is created and it works ok but some times the optimize doesn't work and my client gets 500 server error.
Please let me know if any of you have faced this situation on production server?
Also please let me know how do I fix this issue on production server?
The local server works great without any commands.
Thank you
5 replies
How to disable create button on Wizard's last step using Alpine?
Hello,
I have a 2 step wizard which I am using to add card details for Stripe.
Step one takes the card details and goes to step two to submit the form.
But before submitting the form I need to disable the create button and as soon as the Step two loads I need to send the Step one data (card details) to Stripe JS to receive the token that I want to set as value for Step two's hidden field named card_token.
Once the card_token field is filled I need to enable the Create button to submit the form.
Please let me know how to do that?
I am struggling to make this work.
Thank you so much.
3 replies
How to add card details and generate stripe token using Relation manager form?
Hello,
I am using stripe-php to add card information to Stripe and using card details relation manager for customers.
I am able to add the card details in the self hosted form but Stripe requires us to generate token by sending card details using their Javascript api which I can send by dispatching the Livewire event but I am not able to set the value for the token field with the class card_token on the form after getting response from Stripe.
Please let me know how can I generate the token, validate it and set the token as value for card_token textinput before submitting the form.
Thank you
6 replies
Use form builder and table builder on front-end
Hello,
I am trying to add Filament Form and Table in a Livewire component to use on front-end which but I need to import all the styles and scripts that the dashboard uses please as the form and table are not functioning properly if I am using external Tailwindcss styles.
Please let me know how can I make this work.
Thank you
5 replies
How to populate select list options without pre-selecting them?
Hello,
I am using hintAction withi the Select option to populate the options in my Select (multiple,searchable) input and it loads the lists but auto selects all the options as well.
Please let me know how can I just load the options to the list without selecting any of them?
Thank you
25 replies
Repeater requiredIf validation from the field outside of repeater
Hello,
I am trying to make requiredUnless if the TextInput (outside of Repeater) has a certain value but it doesn't work, Please let me know how can I make this validation work?
Repeater::make("passenger_details")
->grid(2)
->schema([
TextInput::make("first_name")
->requiredUnless('passenger_type', 'self'),
TextInput::make("last_name")
->requiredUnless('passenger_type', 'self'),
TextInput::make("email")
->email(),
TextInput::make("phone")
->tel(),
])
Also I tried $get('passenger_type') inside the repeater and the passenger_type input is outside of the repeater.
Thank you
8 replies
Loosing a really good project because of the slowness in loading components
How can we make the input fields hide/show conditionally without sending requests to the server?
I am developing a car booking project and there my client wants to use the form which loads the form components quickly like we use javascript to show/hide input fields which is much faster than FilamentPHP sending request to server and render it again.
I am using a Repeater with displays conditionally but it is quite slow like it takes 1.2 to 1.5 seconds to load even for a fresh project in production. Also the conditional input fields load slow as compared to the project (angular project) client is currently using and he says the speed is the main part of this form.
Please let me know how can I make the components show/hide dynamically based on other form inputs but not send requests to server at all.
Thank you
43 replies
Multi tenancy sub-domain redirection problem
Hello,
I have multiple tenants attached to a user and I am using wildcard subdomains for each tenant url.
Everything works good but the issue with redirection after logging in has a little problem which I think should be an easy fix but I am struggling to figure it out.
Here are the details:
User is attached to 2 tenants with slugs company-1 and company-2
subdomain is company-1.domain.com and company-2.domain.com
I have setup default tenant and latest tenant in User model.
so the issue is when a user tries to login using company-2.domain.com they get redirected to company-1.domain.com/dashboard where user has to switch to company 2 to access it.
I need a solution to redirect user to the same subdomain which they used to login.
Thank you so much in advance.
26 replies
ReplicateAction with uniqid() as slug giving error
Hello,
I have extended my Page model and PageResource to add is_published and a few other custom fields. I have also added globalscope to not display pages with is_published = 0 for non authenticated users. My client asked me to add a ReplicateAction but since each page has a slug so I had to use beforeReplicaSaved to create uniqid() as slug and it creates the new page with all the details but when it redirects to edit page it gives me this error
"Undefined array key 21" whereas 21 is the auto-increment id.
Below is the code I am using in table actions.
Please let me know how do I fix this?
Thank you
ReplicateAction::make()
->beforeReplicaSaved(function (Model $replica): void {
$replica->slug = uniqid();
$replica->is_published = 0;
})
->successRedirectUrl(function (Model $replica) {
return route('filament.dashboard.resources.pages.edit', $replica->id);
}),
5 replies
FileUpload imageEditor replace instead of adding v1, v2 to the file
Hello,
I am uploading images using FileUpload and I have added the imageEditor option and it works great but it automatically adds -v1 -v2 to the filenames created by the editor. I would like to ask if it is possible to replace the existing file instead of creating the new one?
Thank you
17 replies