Filament

F

Filament

A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire

Join

Testing page footer actions in v4

I'm attempting to call a page footer action in a test for a resource page. Typically, in an EditRecord page for example, we would have these footer actions: ```php protected function getFormActions(): array { return [...

Pagination Cursor not working

Pagination Cursor not working why Filament\Tables\ConcernsCan\PaginateRecords:
public function getTablePage(): int
{
return $this->getPage($this->getTablePaginationPageName());
}
public function getTablePage(): int
{
return $this->getPage($this->getTablePaginationPageName());
}
It expects page to be of type int, but paginateCursor is a string. I don't know if I'm doing something wrong, but it seems like the typing should also have a string type. Making this change to Filament\Tables\ConcernsCan\PaginateRecords and the contract Filament\Tables\Contracts\HasTable directly in the vendor package works perfectly. To get the error, just include: ```public static function table(Table $table): Table {...

Replicate - but display form instead of saving directly.

I want to duplicate a model instance and some required fields should be ignored. In this case the standard replicate action fails because the confirm modal only shows a confirm button and by pressing it the duplicated cannot be saved in the database because of the ignored non-nullable columns. I found this v3 thread but the solution does not work: https://discord.com/channels/883083792112300104/1245204314645987399 After analyzing the core code I found that the solution as simple as adding a $this->schema() . So here is my working custom action class that displays my form inside the replicate modal and allows to fill out the not replicated, required fields:...

Using Icons Inside RichContentRenderer

Is it possible to use icons inside the RichContentRenderer? My component looks like this: ```php...

Multi-tenancy using build in functionality, how to add and manage team members?

As far as i can understand, implementing the basic multi-tenancy functionality from the docs, I only get the very basic team-creating and rename team-functionality. However, as almost anyone with multitenancy, team management is required. I was certain someone must have build a plugin for inviting, and managing team members, something like Laravel Jetstream. Am I looking at the issue the wrong way, or am I missing something? There seems to be a lot of boiler plate code i have to write in order to have an invite-system etc. It just screams at me that someone must have build this already?...

Eager loaded relationship not updating after component action called

I have an action to upload a specific document, in v3 after it was called, my custom entry could use that newly created document via $model->documents but in v4 it does not update. It's like in v3 the whole model would be refreshed including eager loaded relations, but now the relations are cached. I don't want to call $model->documents()->get() because that's going to be a lot of extra database queries (I have quite a few fields), but I need the info to be fresh when an action is run to update the state of the field....
Solution:
Fixed by calling $model->refresh(); after my action is completed. I guess in v3 the caching was more lax, but in v4 it does not refresh the relations etc so you have to do that yourself.

belongsToMany select for relation not working

anyone knows what I'm doing wrong in this Select field with relation BelongsToMany using pivot table public function users() { return $this->belongsToMany(User::class, 'section_users', 'id_section, 'user_id');...

Login page customization

I am new to the Filament. I have setup few resources and it works as expected. However, I want to customize the login and authentication. I want users to enter only TOTP (From Google authenticator App) as password to authenticate him/her. But I can't find views or controller for same. Where are the views/controller stored in Filament so that I can customize it.
Solution:
You have to create a new livewire component and in the panel config ->login(yourcustomloginpage::class)

PreviousUrl Overwritten when Using Multiple Tabs

What I am trying to do: Prevent refreshed browser tabs from inheriting other browser tabs' "previous URL" Our application overrides Filament\Resources\Pages\EditRecord::getRedirectUrl() to redirect to $this->previousUrl after saving, just like in the example in the docs: Customizing redirects.
We've discovered that if a user has multiple tabs open, one of which is on an Edit page, and they navigate around in another tab and then refresh the Edit page tab, the Edit page tab's "previous URL" gets replaced by the other tab's navigation. Does anybody know how to work around this so that each tab keeps it's own "previous URL" regardless of what's happening in other tabs?...

Saving an unsaved id using RelationManager

Hi, I’m building a ticket booking website where each event can have multiple “ticket types.” A ticket type can either be Single or Bundle. Single tickets: regular tickets. Bundle tickets: depend on a “base ticket” (which must be a Single ticket), and when purchased, they multiply the base ticket....

TipTap RichEditor: trouble with lists

I'm editing some HTML rich content under Filament v4. I've observed that the editor makes editing lists nearly impossible if the list items don't contain paragraph tags. To reproduce: My model's data contains the following HTML snippet:...

Customize the topbar

Hi everyone, I’m using Filament v4 and I want to customize the topbar with: 1. A single button to toggle Dark Mode / Light Mode....
Solution:
1. You could hide the current solution in the user menu via CSS and add a new one via a render hook 2. Should be easily doable via a render hook....

Change the position of the Submit button in editRecord

Would it be possible to move the Save changes button that appears at the end of the Form to the end of the report manager Posts list? Thank you.
No description

Customize image html or attributes in RichContentRenderer

Hey! I'm basically trying to lazy-load images in RichEditor content. I tried extending RichContentRenderer and also with "mixin" (like awcodes show me), but I'm not sure if it's even possible......

Nested Resource Header Actions

How can I enable header actions on a nested resource's table under a View-only page? There's no Create button on the Tasks table unless I hit Edit on the project....
No description

Issue with schema reactivity in a custom page

Hello, I'm facing some difficulty in a custom page that loads dynamic schema form a builder. I've managed to reproduce in this simplified example. ...

V4 Repeater - Coloured rows?

Can we colour the rows in v4 repeater? Can't see a method

Just get the original filename?

Is there a way to get the uploaded file's original filename in afterStateUpdated of a FileUpload field? I want to keep the randomly-generated filename, but I want to get the original filename so I can $set() the text of some other fields based on the original filename of the uploaded file.

Hide the column manager

Is there a way to hide the column manager on a table?
Solution:
->columnManager(false) set this on your table
No description