Filament

F

Filament

Filament is a collection of beautiful full-stack components for Laravel.You can get help using it on our Discord.

Join

Rich Editor escaping its own HTML

Hi all, I'm trying to add a Rich Editor to my form, but after saving the data in the database is escaped. It's already escaped when i dd() at EditRecord#148. Because of this the Rich Editor shows as attached after saving. Anybody else had this issue? If so, how can I fix this?...
Solution:
Never mind @Alnuaimi and others: I found a global Laravel middleware messing with the payload and escaping characters like this. I thought Filament had its own middlewares only, but apparently a base layer of middleware of Laravel is also applied. Thanks for your help....
No description

Moving columns in table

Good day, I would like to make the page move the columns of the table according to my preference. How can I do it? Is there any ready-made plugin with such solution? Maybe AdvancedTables has it?

form with multiple fields using the same model property

I have a single amount field on my model, and another field that indicates whether the amount is a credit or a debit. I need to display this data in a form and I'm having trouble creating 2 form fields based on the same model attribute. I'm using this to get my form data (for the sake of this question, i'm leaving out the logic that differentiates between debits and credits): ```php...

Importing TSV tab delimited content using Filament Import Action

Hello, I'm trying to allow the importing of tab-delimited content in a TSV file using the ImportAction in a getHeaderActions function. Here's my code: ```...
No description

TableRepeater / Repeater populating form

Trying to use the TableRepeater plugin and it's working great except I have rows in my database that I want to populate the form with, and I can't seem to get it to do that. I must be missing something. This is an edit modal action on a table row, if that's matters. So the user clicks the table row's edit button, which brings up a modal that should display all the line items of the parent row in the TableRepeater. ```php Action::make('customEdit')...
Solution:
ok, that's helpful. It didn't work with fillFormUsing, but there's a fillForm method and that worked! ```php ->fillForm(function (AutomatedSalesJournalEntryHeader $record) { return [ 'lines' => $record->lines->map(function (AutomatedSalesJournalEntryLine $line) {...

Is it possible to display key : value in a TextColumn ?

Hi all, is it possible for a TextColumn to display the key and the value when the DB field is an array? TextColumn always returns a string without the keys. ...
Solution:
Hi, thanks for your help πŸ™‚ Based on your solution, I managed to get the desired result with that: ```php TextColumn::make('properties')...

Uncaught (in promise) Could not find Livewire component in DOM tree

When navigating through my filament panel intermittently, I get this error, followed by several warnings: "The resource <URL> was preloaded using link preload but not used within a few seconds from the window's load event." There appears to be a warning for all of my bundled assets e.g. app.js, echo.js, async-alpine.js, theme-dK9GWCe8.css, and even livewire.min.js. Does anyone have any idea what could be causing this?

Table CSS for Livewire Page outside Filament

Hi team, apologies if there is a thread for this but I couldn't find anything to fix it. What I am trying to do: I have a page outside the Filament generated pages. Let's call this Posts. On this page I have a livewire table component I created suing this documentation: https://filamentphp.com/docs/3.x/tables/adding-a-table-to-a-livewire-component...
Solution:
```php <!DOCTYPE html> <html lang="{{ strreplace('', '-', app()->getLocale()) }}"> <head>...

SelectFilter->getOptionLabelFromRecordUsing

```php SelectFilter::make('event') ->options(fn (Table $table) => $table->getQuery()->pluck('event', 'event')->unique()->sort()) ->searchable() ->preload(),...
Solution:
Likely because your code is wrong. $actor won't exist... Why not do: ```php...
No description

Prevent scroll function on Form/TextInput numeric field

Is there any solution to prevent the scroll function on this field type? As it is annoying putting in a number, then scrolling on the touchpad and the number changes. I can't guarantee people always tab out of the field. Thanks

Second Panel

How do I create a resource for second panel? My first time try it out

Registration error

Hello everyone, I have the same problem. Tell me if anything else is needed to set up authorization version Filament 3.2 PHP 8.2 Laravel 10...
No description

Secondary Modal Submit Action with RequiresConfirmation

Im trying to add another submit action on a modal that requires a confirmation. Tried adding that, but cant seem to get access to the original actions form. Any suggestions? I tried also using makeSubmitAction too, but it doesnt allow you to add a requiresConfirmation or much else to it. ```php ->modalFooterActions(function (Action $action) { return [ $this->terminationRequiresReview() ? $this->submitTerminationForReviewAction($action) : $action->getModalSubmitAction(), $action->getModalCancelAction(),...
Solution:
try ```php ->modalFooterActions([ Action::make('save_confirm') ->label('aubmit for review')...

repeatable entry

I have 3 tables: Order(id, num,...) Orderline(id, order_id, status,...) Orderdetails(id, orderline_id,produit_name, produit_photo,...) Relations orderline has one Order Orderdetails can have multiple orderline...

Relationship manager does not have Create Action

I have a relationship manager, I've attached it in my Edit Record as well as in View Record. I can add/edit/delete from my Edit Record. Unfortunately, I can't see the Add Button on the right top of my relation manager. Do you know the reason why I can't see it? Please see attached images.
No description

Tenancy with other packages Model

I have a existing filament project used across multiple projects. So I'm trying to add tenancy functionality now to manage all projects within one instance. I have some CMS functionality with a Page Model in a extra package/plugin. My tenant Model is Project. ...

Form field value based on 2 other fields

Docs show how to generate the value of a slug field. And shoes how to test against the old value of the field before changing it. How to fill the value of a field based on the values of 2 other fields? And only fill the third field if it is empty: don't change it if it already has value....
Solution:
Solved: My problem was in the Helper function. It wasn't returning....

SubNavigation Sort Order when Mixing Groups and Items

I want to do Item then group then item, but it seems to always put the items at the top. I dont want put the other items in groups as that changes their design. Any suggestions? ```php return [ NavigationItem::make('Review Status')...

URL for modal window in Resource

Good afternoon everyone! I made a model and resource for it. I decided that I want it to open in a modal (without a separate page) and added the slideOver methond to the edit action. But here's the problem - when you open an element, the URL does not change. What should I do with that? Cause for example, mb I need to throw a link to this element, or when i'll refresh the page it won’t open. Who knows how to solve it?...