Filament

F

Filament

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

Join

filament route - default to a landing page instead of login

I'm building a saas app where having 2 filament panels. 1 for the SAAS admin and 1 for the tenant. * localhost > routes to the welcome page ( as defined in the web route file) * localhost/saas -> routes automatically to the localhost/saas/login page - after login you go to localhost/saas...

Resource as Navigation Parent of Custom page

I am currently trying set a resource page as navigation parent of a custom page. when setting the navigation parent of the custom page by changing the navigation parent property, it simply disappears. class TimeEntriesOverview extends Page {...
Solution:
Solved it, the necessary attributes to set are ```
protected static ?string $navigationGroup = 'Zeiterfassung & Ausgaben'; protected static ?string $title = 'Übersicht Zeiterfassung';...

Import action, unsetting columns not working

I am using the import functionality, but I am facing some problems with the Import columns I need to add 2 columns that are not related with the model because I have some extra logic in the beforeSave that i want to implement but I am getting error:
[2024-11-11 11:54:13] local.ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'start_year' in 'field list' (Connection: mysql, SQL: insert into `codes`
[2024-11-11 11:54:13] local.ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'start_year' in 'field list' (Connection: mysql, SQL: insert into `codes`
I thought that with the unset I would be able to fix it, but it seems I was wrong....

Add Streaming Plugin to ChartJs: Error: "realtime" is not a registered scale.

Hello! I tried to integrate the chartjs streaming plugin (https://nagix.github.io/chartjs-plugin-streaming/latest/) like you can see here https://filamentphp.com/docs/3.x/widgets/charts#using-custom-chartjs-plugins but I have the Error: "realtime" is not a registered scale. I integrated the chartjs zoom plugin as same way without problems....

Export fails, even though I am exporting the exact same columns from the tables.

The table code ```php ->columns([ TextColumn::make('scans.0.scan_time')->label('Entry Time'), TextColumn::make('last_scan_time')->label('Exit Time'),...
Solution:
Nothing wrong in the code. Just clear cache and job tables.

Closing table action modal by another livewire component

I am loading a livewire component with modalContent() as a custom action in a table action. The livewire component serves a form, which listen for the event 'saveVariable'. I trigger the event by the action button of the table action. That works fine, but the modal is always closed, even if the form validation fails. Beacuse of that I'm halting the action after dispatching the event 'saveVariable' to prevent the modal from closing. I submit the modal id (xxxxxx-table-action) with the event and in the livewire component I dispatch the event 'close-modal' with the modal id if the form validates. That works fine, but I'm afraid, that in the future the id of the modal could be changed and therefor my code will be broken. Is there a way to get the name of the modal progrmatical? Or is there another way to close the modal after the form is validated? This is the table action: ...

Multi-tenancy for models with no direct relation to user

If I understand the multi-tenancy I always need to pass the organization relation, since this is what my tenancy is referring to. Sadly at some models I don't have direct relation to the user or the user is a Many to Many or One to Many relation so that I can get to the organization. I get the following error. I already have set the tenant for the panel by using...
Solution:
Just link game to organization too :
$table->foreignId('organization_id')->constrained()->cascadeOnDelete();
$table->foreignId('organization_id')->constrained()->cascadeOnDelete();
So like that, you can well tenant everything and if you delete an organization, it will automatically delete games too 🙂...

Hello

I am creating an ERP for invoices. I'd need to use the repeater or tables for invoice's items, but I would not to send them to database before completing the document. What I mean is: - open the invoice edit page - select customer - add items - press Create button...

Redirect is not working properly

Being logged out, for some users if they try requesting ex. https://test.com/admin/products/1/edit?activeRelationManager=0, login, they end up on the dashboard. This is working fine for me and I'm trying to see what the issue is but couldn't find any lead. Any kind of help would be highly appreciated....

custom field styling

I am not able to style my custom field using tailwind classes! I created the field using make:form-field command but when using tailwind classes to style the component not all classes are being applied!...
Solution:
To have all classes - you need to build a custom theme. By default, Filament comes with pre-compiled class list (since that's how tailwindcss works). If you need anything else - you have to use custom themes...

Composite Key Model - Pagination

I have this issue with pagination in table builder where the page number is not showing when using Model with composite key, and no records show up when I click next page

filament

hello everyone

console error ':popover-open' is not a valid selector

Is it filaments error or livewire? In console shows error: "uncaught (in promise) DOMException: Element.querySelectorAll: ':popover-open' is not a valid selector" and nothings shows on screen. If I hit refresh, then loads panel, or open in new tab, alsou shows, but clicking on links get error. Can it be, because my Firefox version is 115.4.0esr?...

is it possible to have clusters in my plugin?

Hi everyone, I'm prototyping a plugin for filament and I wanted to add clusters same way you add resources and pages but it seems to not be on the documentation, Is this possible? if so, how?

Adjust the component height

How can I make the fileupload and the textarea in the same height? I've tried added ->extraAttributes(['styles' => 'min-height: 76px']) in textarea class, but it's not changing.. What else can I do?...
No description

Help with merging navbar to custom page

Newbie question and I hope it's okay to ask this kind of question here. If I want to merge the Filament top navbar into the default welcome.blade.php, with a link to the Filament admin panel (that requires auth) which also has a link back to the default welcome page, then what might be the best way to approach this?

Run function after "Save" button is done

I would like to execute a function after I have clicked on ‘Save’ and the save was successful
Solution:
You can use afterSave hook

how to handle widget with multiple dashboard ?

i create 2 dashboard with different widget, then how to handle widget in spesific dashboard ? because i want remove 3 widget after form and chart
No description

Conditionally hide SelectColumn based on email domain

I'm working on a Laravel project using FilamentPHP and need some help conditionally hiding a column in a table. ```php public static function table(Table $table): Table { return $table...

How to Pass Dynamic Data from Filament Form to Livewire Component for Price Calculation

I'm trying to create a Livewire component that displays the price of a product within a Filament form. The form allows users to manipulate several select fields (to change color, model, etc.), and each change can affect the price. My goal is to display the updated price whenever the form values change. I've been using this documentation page as a reference: https://filamentphp.com/docs/3.x/forms/advanced#inserting-livewire-components-into-a-form Currently, I can pass fixed values to my Livewire component like this:...
Solution:
Livewire::make(CheckOutInfoList::class, fn (Get $get) => [
'field_1' => $get('field_1'),
]),
Livewire::make(CheckOutInfoList::class, fn (Get $get) => [
'field_1' => $get('field_1'),
]),
...