treii28
treii28
FFilament
Created by treii28 on 11/20/2024 in #❓┊help
Trying to modify filament form fields from custom Livewire Field component.
I want to be able to update a couple of fields in a filament 'step' based form by using a google-maps-api clickable map. I'm trying to learn livewire a bit more while doing it and am loading the map code into a livewire component, but I can't seem to figure out how you are supposed to take data coming back from the map 'click' listener event and then have filament update the lat and lng fields in the form. Since I strongly suspect all my attempts have been blind shots in the dark or are offtrack. So does anyone have any suggestions on how to do this?
4 replies
FFilament
Created by treii28 on 11/1/2024 in #❓┊help
Cascading form is losing set value
I have a form that is using ->reactive() with ->options() where the options are set based on the value (Get $get['otherfield']) in another field. Basically there are three enjoined fields, where the prior field can potentially narrow the options in the latter fields. I am changing the options simply to make it easier to find the values in the second and third fields. It behaves similar to a Country->State->City type list, where initially the 'State' and 'City' fields include an exhaustive list, but when Country is selected, only states and cities in that country will be in each field and so on. (in my case they are Continent->Zone->Instance - it's a tool for Warcraft 'item needs') The problem occurs when the options list 'changes' when a value is set for one of the dependent fields. Even if the value for the dependent field exists in the reduced list of options, the set value disappears. This is a problem especially because the setting of the Continent triggers a change in the 'Zone' options, when loading an existing record, Continent will be set but Zone and Instance will not be set. How can I preserve the value set and then set the dependent fields if and when the option still exists in the reduced select list?
2 replies
FFilament
Created by treii28 on 10/23/2024 in #❓┊help
Create Comment - where to inject parent ID?
No description
5 replies
FFilament
Created by treii28 on 10/9/2024 in #❓┊help
Cascading/conditional form on polymorphic relations?
I have a model where I created two polymorphic nullable relations to change the 'nature' of an order based on what type of product it is. The company has two main types of products, one in a book-like album form, one as a single print item. Thus the OrderItem model can have either an albumitemable or printitemable morph that adds the respective properties for the album and print variations. Now I'm trying to add this to the orderitem form. So basically I need a selector or perhaps radio-box elements that allow a user to select if it's an album or a print product, then have the associated properties (form elements) show for that type. The filament documentation is so piecemeal I can't even seem to find anything that tells me how to add something so simple as a form field that won't be attempted to be saved, no less figure out how to use that field to show/hide other element groups in the form. Any help is appreciated.
5 replies
FFilament
Created by treii28 on 10/2/2024 in #❓┊help
Including default header in custom header
Add to Existing Header on a view page I need to load an external javascript file on a given page. Examples I found suggested using a ->getHeader() with a custom view to do this. But using the custom view gets rid of the default header. I just need to add to it so it loads the script with a script tag. Is there a way in the custom view to append the default view after it? I tried the following but it looks like the default ->getHeader() just returns a null value: public function getHeader(): ?\Illuminate\Contracts\View\View { $header = parent::getHeader(); return view('components.custom-header', ['header' => $header]); }
1 replies
FFilament
Created by treii28 on 10/2/2024 in #❓┊help
text list form field? (is there any kind of contrib/repository for custom components?)
I'm mostly curious if there is any kind of website or repository where people make available custom components and widgets for filament? I have a need for something akin to the key/value input but only need it to deal with a list of values. It's not a deal breaker if I can't find something as this is mostly a 'learning' project. But thinking about it makes me wonder if there are any contrib collections of such custom fields for forms, tables and infolists already out there on the net like there are for other platforms?
3 replies
FFilament
Created by treii28 on 9/26/2024 in #❓┊help
Run a javascript function when table is redrawn
I have an external tool that adds tooltips to links when a page loads. The problem is, if Filament re-orders or filters the rows, thus updating the page content, the links vanish when the content is re-drawn. I found a function in the tool to trigger the modification of links, but I now need to know how I can have that javascript function run after filament updates the table contents.
12 replies
FFilament
Created by treii28 on 9/26/2024 in #❓┊help
Adding CSS to table group label/name
How can I add formatting such as bolt text or a specific color, a border/background, etc to the lables a table puts on groups? (when using ->defaultGroup(Tables\Grouping\Group::make()) There id not appear to be a ->badge() or ->html() like there was for table columns.
7 replies
FFilament
Created by treii28 on 9/26/2024 in #❓┊help
Table group of groups?
Is it possible to nest grouping or groups in tables? I basically have a pivot table that lists a number of items and links them to a listing of people. Each of the items relates to a given location. So basically I have something like: Person model - using person.name Item model - using item.name and item.location Pivot relation model - has a pivot.person and pivot.item relationship Basically I would like to group these by locations -> persons - > items So that: the outer groups would be the various locations of the items locations would be grouped into persons the items relate too each lotation -> person would then list those items related to that person in that location
1 replies
FFilament
Created by treii28 on 9/23/2024 in #❓┊help
Nesting Breadcrumbs?
I found the documentation on how to set up a Navigation group or to assign a page or resource as a child of another page or resource, but the breadcrumbs don't appear to reflect these relationships. e.g., I'm setting up a tool as a package, so i want all the menu items to show up under a single item that folds or hides (group and parent/child both seem to do this) when not in use. My tool has a color model that stores default colors used by the tool, as an example. When I select Color, it defaults to going to the list of colors. I can set a $stub value that will change the url route to be */MyTool/Colors But instead of showing MyTool > Colors > List, it only shows Colors > List on the breadcrumbs at the top. How do I get the breadcrumbs to reflect the group?
6 replies
FFilament
Created by treii28 on 8/23/2024 in #❓┊help
What controls browser file masking in file upload?
I notice that when I add ->acceptFileTypes([{list of mimetypes}]) to a form, the popup in my browser 'masks' the files shown saying 'Custom Files' in the dropdown. However, the mime-type I need for laravel for the file type I'm uploading (a ttf font) doesn't seem to be including the .ttf extension in the files shown by the browser's file popup. Is there a way to control that file mask somewhere?
2 replies
FFilament
Created by treii28 on 8/21/2024 in #❓┊help
Tying styles to package generated modal?
Short of hardcoding a <link> into the blade template, is there any way to 'register' or otherwise include a specific stylesheet url into a widget or modal that in inside of a composer package? I'm building a tool to help me generate XML for a print-on-demand service and one of the pieces is a package that converts text into an SVG file. I converted a number of fonts to SVG Fonts and use these to generate the final SVG of customized text. I would like to be able to upload and enable/disable the fonts used by the tool which means that if I want to 'see' the way the font looks when selecting it in my modal form, I need to code-generate css with @font-face definitions for the SVG fonts themselves. I see examples of 'registering' CSS and JS files in the main Service Provider, but I only need these to be loaded when the modal itself is included in the page.
1 replies
FFilament
Created by treii28 on 8/13/2024 in #❓┊help
Generic admin panel (not related to table/model)
How does one create an admin 'utility' page/panel/widget/whatever that is not related to an existing model/table or the database? (all the help pages I can find seem to relate to dealing with laravel models) I have a tool I use in conjunction with a management back end that generates an svg file from text. I'd like to wrap it in with the other admin tools for that package/plugin. I'd like to use the filament form builder tools if possible to do it. (I already have functions ready to generate the select options/values I need for a form)
23 replies