bionary
Date + Time Steppers / Meridiem
I'm cannot find a happy solution between using the native HTML5 datetime vs Filament's datetime implementation.
- I'm in U.S. and 12 hour clock (with meridien) doesn't seem to be possible with
->native(false)
- But when using the native HTML5 datetime steppers don't work: ->minutesStep(5)
Anybody else facing these annoyances and find solutions?
Is there a way to get both 5-minute steps AND a 12-hour clock?2 replies
Show First image: SpatieMediaLibraryImageColumn
How can I limit the "thumb" image in my table to the first image only when my record has more than one Spatie Media records associated?
I am using SpatieMediaLibraryImageColumn and always have several media images related...but they are cluttering up the table. I want to show the first one only.
I thought I could directly fetch what I need (pseudo-code):
->getStateUsing(fn($record) => $record->getFirstMedia()...)
But, it appears that ->getStateUsing()
is ignored completely15 replies
Spatie Media Library Conversion Quality NOT Applied
When I convert a PNG using the model method
->addMediaConversion()
the ->quality()
setting is ignored when combined with ->background('#ffffff')
This is problem for all PNGs with transparent backgrounds. You have to explicitly set the background or else it ends up black in the coverted jpegs.
I ran into this problem about 6 months ago...I ignored it. I just upgraded related composer packages and tried again. Still getting these results.
Can anybody offer and help? (Note: "works for me" comments are not necessary and counter-productive)
Thanks!11 replies
Spatie Media Library breaks with ->disabled()
There appears to be a bug when using Spatie Media Library with the
->disabled()
method.
Saving the record throws an error, because it is trying to save the media to a column on the model (rather than in the media table)
This yields error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'my_download' in 'field list'
Once ->disabled()
is removed the plugin works as intended.
plugin v. 3.2.939 replies
Anybody find a decent solution for table images to a lightbox?
(I'm surprised filament doesn't have a builtin lightbox for table records...it seems to have everything else imaginable!)
The 2 lightbox plugins are not solutions.
- https://filamentphp.com/plugins/njxqlus-lightbox
This plugin doesn't support use in tables, so that's of no help here.
- https://filamentphp.com/plugins/solution-forest-simplelightbox
This plugin simply doesn't work and doesn't seem to be actively maintained.
10 replies
Fire js event from SelectColumn
I cannot seem to fire an event from SelectColumn in v2. of filament.
Even when inspecting the console there doesn't seem to be any events triggered at all with the select column change.
effects.dirty[]
How can I trigger a js event when I change the dropdown here?10 replies
Refreshing Form F v2
I have a scenario in which I alter saved model properties using model events:
static::saving() ...
As a result I need to refresh the form fields after being saved, because they are sometimes changed on the backend.
Using filament v2 here...I cannot get this to work.
On my edit page of resource:
This does't work.
Have any ideas?1 replies
Filters applied on load?
using Filament v.2
I have a table widget with some filters. I have a "less then pricing" filter for input pricing.
When the page/table loads the filter is being applied automatically with a value == 0.
How do I prevent table widget filters from being applied on load? (with filament v.2)
Relevant code:
2 replies
ToggleColumn Alpine Error
Anybody try ToggleColumn lately? I haven't used a ToggleColumn on a table in a long time...used it today and it seems broken.
I get a js console error: "module.esm.js:421 Alpine Expression Error: await is only valid in async functions and the top level bodies of modules"
My front end skills are garbage and to the best of my knowledge I haven't done anything out of the ordinary to cause this.
Any ideas?
4 replies
Persist data via relationship manager Create & Create Again
On a normal page form I can persist data for auto-filling in repetitive fields by flashing the session on save like:
Now I need to do this with the Relationship Manager. When attaching records how can I access the save and save another action to flash the session?
1 replies
Multi-Select Relationship by Image / Visually
I have a model:
How can I give the same same experience/results as a mulit-select \Forms\Components\Select() BUT with images rather than a text dropdown. In short I need the user to be able to search for images and select them to assign many artwork images to a single exhibition. Should I but using select? or maybe a RelationManager is better? Would love some advice please My latest attempt is with a relation-manager but that attempts to create new artwork which I don't want...I need to assign many artworks, visually to a parent exhibition.
Exhibition
which can have many Models: Artwork
How can I give the same same experience/results as a mulit-select \Forms\Components\Select() BUT with images rather than a text dropdown. In short I need the user to be able to search for images and select them to assign many artwork images to a single exhibition. Should I but using select? or maybe a RelationManager is better? Would love some advice please My latest attempt is with a relation-manager but that attempts to create new artwork which I don't want...I need to assign many artworks, visually to a parent exhibition.
43 replies
Native Back Button leads to Broken Resource Limits
1. Set an admin resource table to something other than the default: "50 per page" for example
2. Click to view an item
3. Click native back button
4. Unexpected results on the admin table
The page goes back to the admin resource list, displays "50 per page" at the bottom of the table, but only shows 10 records.
Is there a fix for this?
Thanks !
6 replies
Create & create another - reuse fields
When clicking the "Create & create another" button is there a way to reuse some of the input fields? (Have some chosen inputs default to the previous value that was just saved) I have a massive number of fields and many of them could benefit by retaining the same info.
10 replies
Sharing form() Resources ?
I was wondering if I could load another resource's $form into the
--simple
modal of a different resource?
Use case: I can quickly access resource views quickly such as comment threads (from dash) related to other models...rather then having to go to that resource table, find the record with comments, click through...etc.. Having a table of comments is not very useful, but clicking through to the record where all of the comments exist on the related model is more useful I believe.
From my attempts the trick seems to be associating the model record with the form, while inside of another resource. Not sure how to do this.
An example from my code is:
I'm referencing the form above, but it obviously has no awareness of the correct model. Are there any methods that allow passing in the correct model/record?
OR maybe I'm thinking about this incorrectly, or it's quite possible that this is not even possible with filament.69 replies
Complete headings set with RichEditor (trix)?
Anybody know any options for adding more headings to filament's
RichEditor (Trix)
form input?
Right now the only options are "heading" and "Subheading" which resolve to h2,h3 tags. I like the trix editor but would like to have h4, h5 as an option as well. Thanks.9 replies
How to filter table based on grandparent relationships?
Say I have relationship structure: Project > Category > Article > Illustration
I'm interested in filtering by Project when viewing the Illustration list.
I have set up all my
I also realized that you can do some filament stuff for Form: Selects in forms like this: That admittedly works for forms, but I cannot seem to find a similar / suitable solution for filtering table data based on grandparent relationships. (I also experimented with the
belongsTo()
relationships. It's simple when using pure Laravel; to traverse back up the parents:
But in filament I'm not sure how to handle this type of filtering. I realize this would be easy if Laravel handled nested relationships but apparently it does not 😦I also realized that you can do some filament stuff for Form: Selects in forms like this: That admittedly works for forms, but I cannot seem to find a similar / suitable solution for filtering table data based on grandparent relationships. (I also experimented with the
belongs-to-through
package, but that doesn't seem to work either)
Any help would be appreciated, thanks!11 replies
Conditionally Prevent Record Edit?
I know I can disable form inputs one-by-one via
Thanks in advance for any guidance!
->disabled(...)
. But, what if I wish to prevent editing for entire page based on a field in the model. Like if $record->is_locked == true
?
If would be great to prevent the edit page from opening or in the least open to a view page.Thanks in advance for any guidance!
9 replies
Additional Info Fields in Form
What is the best way to go about adding supplemental data fields to a form? But the catch is, it shouldn't be handled as form fields. (not saved)
I often find that including stuff like parent-relationship info in or near the form is helpful sometimes.
I tried using
ViewField
and making sure that my view had non-form elements in it, but when upon saving the form, filament is expecting a saved data field for "parent_properties" as setup below.
I know I can use one of the mutateData...functions to strip the form input prior to being saved, but I can see this getting sloppy and bloated quickly. What is a better approach? Thanks!6 replies