binaryfire
Optimizing / compressing image uploads before saving to disk (no media library)
Hi all
I’ve got several optimisations I want to apply to images uploaded via the upload field before they’re saved to storage.
I don’t need help with the optimisations themselves. What I need to figure out is how to apply things to the uploaded file before it’s saved from Livewire’s temporary storage to my S3 disk.
Any ideas? I’m not using any media library plugins so I need to work with the files directly.
7 replies
Autosave entire edit form with debounce
Hi all
Has anyone implemented autosaving for an entire edit page's form, along with some kind of debounce? I'll need to use debounce to avoid blowing up my server.
Honestly have no idea on the approach to take for this one...
Would I have to set
live
, debounce
and use afterStateUpdated
on every field of the form? Or is there a cleaner way?
Also not really sure of the best way to save the current form state to the record using afterStateUpdated
Any help or suggestions would be appreciated. Thanks!31 replies
Builder field - JS to collapse all other blocks groups when a different block is clicked
Hi all
I have a project with a builder field and I need to automatically expand a block's fields when a block is clicked, as well as collapse all other open blocks at the same time. The idea is that only one block should ever be expanded at a time and I need to do that without the user clicking any "collapse" / "expand" buttons. It needs to happen automatically when a closed block is clicked.
Does anyone know how I could do that? I'm assuming with a little Alpine magic.
5 replies
Table `recordAction()` with redirect
Hi all. When a table row is clicked, I need to run some code to generate a URL then redirect to it. It's a SSO link so it has to be generated on click (so I can't use
recordUrl
).
Does anyone know how I could do this? I've played around with recordAction
but haven't been able to find a working solution.5 replies
Make clicking on a table row open the ViewAction modal
Hi all
I've got a resource without a create, edit or view page. There's just a List page with a table row ViewAction, which opens in a modal.
How can I make clicking on the table row open the ViewAction modal?
2 replies
Fill modal infolist from array
Hi all.
I'm using a Table row action to display data from another record in a modal.
With forms, I can use an action's
->fillForm()
method to populate the modal's ->form()
. Is there a way to do the same for a modal's ->infolist()
?6 replies
Using an enum with a toggle
Does anyone know of a clean way to use enums with toggles? One of my models has a status column with only 2 values - active and inactive. I want the toggle to switch between these values. I'd prefer to use an enum vs a boolean because I want to display the status using a badge (with labels, icons and colors).
25 replies
Exclude a page from global panel middleware
Hi all. Is there a way of excluding a page from the global panel middleware? Use case: I need to prevent access to a panel until a user has verified their billing information.
I've added my
RedirectIfBillingNotVerified
middleware to ->authMiddleware()
and it works, but the page with the billing verification form needs to be excluded. I could create a separate (non-panel) page but I'd prefer it to be a panel page so it inherits the panel styling. Is there a simple way of doing this?5 replies
Disable topbar on an individual custom page
Hi. I'm rolling my own two factor auth and have created a custom
SimplePage
page for entering the code. It's all working, but the database notifications trigger and profile dropdown are showing. I can't hide them with CSS since that isn't secure. Is there any way to disable them on a specific page?2 replies
Can't get extraModalFooterActions to work
Hi. I can't seem to get
->extraModalFooterActions
working. When I use Filament\Forms\Components\Actions\Action
I get an Typed property Filament\Forms\Components\Actions\Action::$component must not be accessed before initialization
exception:
And when I use Filament\Actions\Action
the button appears but doesn't open a modal or execute the code in ->action()
:
17 replies
Use anonymous actions inside a modal form
EDIT: This actually works. The problem was caused by something else.
Hi all
Is there a way of using actions inside a modal form? I don't mean in the footer - I mean in the form body eg:
This isn't working for me. I'd really prefer to put a "Resend" link under the input instead of a button in the footer.
4 replies
Clean way to avoid escaping of quotes in JS in extraAttributes
Hi all
I'm using
HtmlString
when using JS in extraAttributes()
but it's adding slashes before all single and double quotes. The only way I've been able to avoid that is by using Illuminate\Support\Js
:
Which isn't very readable... Is there a cleaner of doing this?7 replies
Override `getColors()` from enum for toggle buttons
Hi all.
I'm using an enum in 2 places: a badge column and a toggle button.
The badges need to use the colors defined in the enum, but I don't want the toggle button using them. The toggle should just use the default styling (highlight the selected option using the primary color).
Any idea how I can do this?
2 replies
Field state is lost on save to JSON columns when invisible
Hi all. Not sure if I'm doing something wrong, but fields that are conditionally hidden using
->visible
are getting nulled when saving them to a JSON column.
For example let' say I have this:
If I already have something in the text field, then switch the toggle to off and re-save, the value in data.group1.my_text
(the text field) is removed. It's as if the field value is set to null when ->visible()
is false. Is that normal? I need to be able to hide the dependent field without losing the data on save. Any ideas?3 replies