Filament

F

Filament

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

Join

Tailwind class "!" prefix removed when using Panel from custom package

Hello! I've created a Laravel package and a panel provider inside. Everything works just fine however I have a strange issue with tailwind. It does not matter whether I add custom vite theme to the panel or just use a default theme. There is a !max-w-[14rem] class in dropdown by default. I can see this class in css output generated by Filament and also in my custom theme. But when I load a panel from my package, the ! prefix is gone in html! When I have a fresh Laravel app with filament inside, the prefix is there. Any ideas what could I check to debug it?...
No description

requireconfirmation for notification action

look at this code \Filament\Notifications\Notification::make() ->warning() ->title('Attention') ->body("There are {$itemCounts} item inside repeader. What should i do?")...

Typed property Filament\Tables\Filters\BaseFilter::$table must not be accessed before initialization

I have a ListRecords page with a table and 3 stat widgets. The widgets are setup to interact with the filtered table via the ExposesTableToWidgets and InteractsWithPageTable traits . The table has 9 different filters. 8 out of these 9 filters work great and filter the table and the widgets react to the filtered table. However, one of these filters, the only one that is a relationship to the data causes an exception to be thrown. I'm not sure how to even begin troubleshooting this but this is the filter causing an issue:...
Solution:
I managed to solve this. I'm using kenneth-sese-advanced-tables plugin and it turns out I had to use the exact column name as the filter name. Therefore adding account.name to the make method resolved my issue. ```php Tables\Filters\SelectFilter::make('account.name') ->label('Account')...
No description

User administration for tenants

I would like to have a page where the tenants can manage their members, ie. change role/profile information and invite new members. If I simply make a resource for the Organization model (which is my tenant model) and make a relationshipManager on that, then I can access the organization and modify the user and pivot attribute. But I want the tenants to be able to do that also, but obviously only for their current tenant......
Solution:
Overwrite the getEloquentQuery() method on the Resource and add a ->where() clause when the user is a tenant

Update a field based on select value

I have a field called 'Country' where a user can select a value. When a user selects a country, it gets stored in the database. ` Select::make('country') ->required()...

afterstateupdate

I have a form that contains Country and phone fields, for phone I used ysfkaya/filament-phone-input library, I want to show the dial code and flag in phone field based on the selected country knowing that country table in db has id, dialCode, name. You can find how the phone field appear in the attached image. Your support is highly appreciated....
No description

FileUpload::make()->enableDownload() not working

I want to give download option on file upload. Clicking on the download icon opens the image in a new tab but does not download.

Action outside of the panel not showing modals

I have a component outside of the panel: ```php class Search extends Component implements HasForms, HasActions {...
Solution:
did you added the: <x-filament-actions::modals />...

Change default URL if not path has been set

If i go to domain.com it goes to first item of first group on navigation Item. How can i change this, and if not path its set on url it redirects where i want? Thanks...
Solution:
maybe via custom middleware?

css of select field not working anymore

Using filament 3.2 in Laravel 10, the css of the select dropdown is not applied anymore to the item list. No errors in browser console or network tab. Moving back to the commit where it still works does not help me, as it seems nothing related to css was changed there. Here's some extra info: ...
Solution:
Hi, I found the answer to the 'problem' after noticing on another page that I had a dropdown with the 'correct' and 'incorrect' formatting on the same page. The difference between the two was that one of them had the method '->searchable()' chained to it, which has another, in my opinion nicer, layout for the itemlist than a non searchable select. Sorry, had to obfuscate the text of the items in the screenshot which makes it less clear....

Redirect after registration

How to add redirect after form registration?
Solution:
it can handle via the controller sir

Hidden create & cancel button, connect between Livewire component and action

I am making a table with headerActions() above in a Resource: ``` public static function table(Table $table): Table { return $table...

Livewire component grid in template does not render as grid col, unless use col-start-*

Hello, I'm using a custom Livewire component in a Filament form. I'm trying to display a label and a value in a 2 column format using .grid-cols-2, but it does not render like so (cf. screenshot #1). If I use .col-start-1 for the label and .col-start-2 for the value, it works, but I think it's not a normal behavior. ...
No description

Global Search Title - App\Filament\Admin\Resources\Model is not available

I am trying to alter the global search title and also the URL for my 'BookingResource'. I have followed the documentation and other tutorials online. However I cannot work out what I am doing wrong! I have attached 2 images, one of my code and one of the error. It doesn't seem to be able to find the 'Model $record' parameters....
Solution:
import the Model use Illuminate\Database\Eloquent\Model;...
No description

Why doesn't the color of the login page and remaining password change depending on the theme I choos

Why doesn't the color of the login page and rest password change depending on the theme I choos
No description

Update specific column data of each row of another table when reordering the rows of category

Hello guys, I want to run static "changeSort" when reordering the rows ->striped()->reorderable('sort')->reorderRecordsTriggerAction( fn (Action $action, bool $isReordering) => $action ->button()...

How to access Model $record when using ->visible() or ->hidden()?

This is not working ``` TextColumn::make('email_verified') ->visible(fn(User $record) => $record->verified()),...

How to Access Data Table in Filament RelationManager to Create a Widget?

Hello, I need some help with accessing the data table within a RelationManager. Specifically, my goal is to: 1. Access the Eloquent query builder instance for the table data within the RelationManager....

How to hide the field but still get the data

I have a submission date field, which i want to automatically be set to now, but i have hidden it, so now the input isn't being fetched when the form is submitted ```php Forms\Components\DateTimePicker::make('submission_date') ->hidden()...