Filament

F

Filament

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

Join

Select Filter with nested relation won't filter

```php public static function productFilter($relationship = 'lineItem.product'){ return SelectFilter::make($relationship) ->label('Product') ->relationship($relationship, 'name')...
Solution:
Found the problem. the Select filter name needs to be the attribute name
product_category_id
product_category_id
like this:- ```php public static function productCategoryFilter($relationship = 'product.productCategory'){ return SelectFilter::make('product_category_id')...

Custom page without upper menu and sidebar menu

Hey guys, Does anyone know how to create a custom page without this upper menu and the side sidebar? I need to disable only for a specific page the custom page....
No description

How to add custom html text or just insert HTML Entities inside hintIcon tooltip

Textarea::make('data')
->hintIcon('heroicon-m-question-mark-circle', tooltip: new HtmlString('Gender &rarr; M/Z, M/Ž, M/F<br>Birthday &rarr; DD. MM. RRRR, DD. MM., DDMM'))
...
Textarea::make('data')
->hintIcon('heroicon-m-question-mark-circle', tooltip: new HtmlString('Gender &rarr; M/Z, M/Ž, M/F<br>Birthday &rarr; DD. MM. RRRR, DD. MM., DDMM'))
...
...

how to make $shouldRollbackDatabaseTransaction to true in Halt class

In BasePage class: protected function halt(): void { throw new Halt(); }...

Livewire pest plugin code replication

How can we get the same result using pest livewire plugin function Livewire::withQueryParams(['search' => 'hair']) ->test(SearchPosts::class) ->assertSee('Testing the first')...
Solution:
Probably as second param to livewire() ? 🤔 Something like: ```php...

FilamentIcon::register view() wrongly (?) rendered as image source

I am trying to replace an icon. For example: tables::actions.filter In the docs it says:
Alternatively, you may use HTML instead of an icon name to render an icon from a Blade view for example:...

Textarea and select field disabled() issue

I have applied ->disabled(fn (Get $get): bool => $get('same_addr')) based on checkbox [same_addr] value , but when I checkbox checked then it disabled and again if I uncheck then textarea and select field not enable to edit. What is issue?
No description

Avoid Section to break and add horizontal scrollbar

I don't want my section to break and instead add a horizontal scrollbar, but I can't get this to work. I tried to add overflow-auto like so ``` Section::make()...

How to structure ZIP files with folders

Im trying to put the files based on the collection tried this, but it return me all file instead foldered based in collection ```php $downloads = $yourModel->getMedia('downloads'); $downloads2 = $yourModel->getMedia('downloads2');...

Make placeholder text black

How can I make my input placeholder text to be black?

How dependent is Filament on Livewire?

If Filament needs Livewire, then When I use plain Laravel and Filament admin panels, Table and Form Builders worked there. No livewire involved. So how did that work?...

How can I change the Label of Permission (Shield)

Hello, I am using the Filament Shield plugin, if I create 2 Resources in 1 Model, how can I change the Label of Permission? Example: Ticket (Request for quotation), Ticket (Web Maintenance)...
No description

Fields being cleared out due to $set call on other fields

This is a bit hard to explain. I have a repeater with two fields, height and width. The repeater is live as are the 2 TextInputs. Then I have a placeholder which does a bunch of calculations. ` Placeholder::make('') ->content(function ($get, $set) { $total = static::newCalcTotal($set, $get);...

searchable attribute

I created an attribute that combines the first name and last name of the customers relationship. This makes the column unsearchable. `protected function getFullNameAttribute(): array { return $this->customers->map(function ($customer) {...

Changing the MorphToSelect Placeholder

Is there a way to change the MorphToSelect placeholder? I get this error when using ->placeholder() Method Filament\Forms\Components\MorphToSelect::placeholder does not exist....

Bug in Select Form Component Toggle Disable Enable

I would like to know if this bug is resolved or not ?

Adding navigation inside cluster to CreateRecord page

I want to add navigation (as is in ListRecords page) to CreateRecord page, is it possible?
Solution:
add this in the CreatePage ```php public function getSubNavigation(): array {...

Add an option to Checkboxlist via an Action

I'm trying to recreate similar behaviour to the ->createOptionForm() of the Form\Select component https://filamentphp.com/docs/3.x/forms/fields/select#creating-a-new-option-in-a-modal but on a CheckboxList. I was hoping I could utilise either the ->helpertext() or ->hint() methods and trigger an Action. It renders ok - but the Action doesn't trigger the modal/form - is this possible or do I need top change my approach?...
Solution:
Im not sure that ->helperText() accepts an action by default. But maybe you could use ->hintAction() instead? 🤔

Failed to disabled select before another select

```Forms\Components\Select::make('from_id') ->relationship(name: 'from', modifyQueryUsing: fn (Builder $query, Get $get) => $query->where('id', '!=', $get('to_id'))) ->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->holder->name}") ->preload()...

Column URL - apply only to text, not the whole cell?

My users are a bit thrown off that in an otherwise clickable row, the whitespace in a URL column follows the URL, rather than the row-click behavior. In their defense, mousing over the text creates an underline as if only the text is the link. Perhaps if mousing over the whitespace also triggered the underline, the current behavior would be more intuitive. Can anybody suggest how to accomplish either? Thanks in advance....
Solution:
You could create a custom column extending the TextColumn and customizing what you need https://filamentphp.com/docs/3.x/tables/columns/custom...
Next