Filament

F

Filament

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

Join

Modal closes only on certain field when I click away

I just upgraded from filament V3 to V4 and noticed modal isn't closing when clicking away on certain field. I have ->closeModalByClickingAway(true) on my modal, when I'm on 'title' field and click away the modal doesn't close, I don't get any error anywhere, when I then click on 'content' field, I can click away and the modal closes, again no errors anywhere. Any ideas? Code in test123.txt

Refresh nested RelationManager (C) when B changes in Resource (A)

Content: Hi, I have a Resource (A) in Filament 3.x using Livewire in the main Resource. ...

Table with Records (no Query) crashes while using summarize

Im using a table with static records and want to show a sum at the end of the table with the summarize method. Here is my code: ```php return $table...

When opening and closing modal I get: "Could not find Livewire component in DOM tree"

I just upgraded to filament V4 and found out this is happening, but can't figure out why. I've found two posts related to this on here and one online regarding grammerly extension causing issue, but nothing helps me here. Tried with Brave and Firefox, same thing. `public function editTableAction(): Action...
Solution:
Found out the issue, so if I comment out the live() method it's not causing error any more: `RichEditor::make('content') ->required() ->maxLength(65535)...

Custom Page

until now i cant understand how can i use custom page. How can i create like timeline that filament dont have. How can i use livewire function for that. Can anyone enlighten me?
Solution:
Pages are just Full-Page Livewire components. You can do anything that you can do in Livewire or Blade.

Can I default a Resource relationship to show an edit form instead of table view?

I theorise that I would like to do this in two scenarios: 1. On a one-to-one relationship 2. On a one-to-many, however I will specify a single record to display via a URL parameter....

Filament Helpdesk Plugin

Hi! We submitted a PR for our plugin to the Filament repository (https://github.com/filamentphp/filamentphp.com/pull/990). Could we get an update on when we can expect it to be reviewed and potentially merged? We're excited to contribute and really appreciate your work!
Solution:
Plugin submissions are usually reviewed once per week or whenever Saade has the time for it.

Can't use Tailwind-classes anymore after update to Filament V4

Hey - after following the upgrade-guide from Filament 3 to Filament 4 it does not seem to recognize tailwind-classes anymore. I'm using a view for my resource-column-label which does this: ``` <div class="flex items-center" @if($tooltipText)x-data x-tooltip.raw="{{ $tooltipText }}"@endif> @if($searchable)...
Solution:
did you run the npx upgrade? You are right looking at V4, but you need to include your blades in the v4 classes see: https://filamentphp.com/docs/4.x/styling/overview#using-tailwind-css-classes-in-your-blade-views-or-php-files So you should have a path to your custom view folder....
No description

Setting an error message to a field manually

Is it possible to set an error message to a field manually within afterValidation? Using a notification doesn't really fit here. ``` ->steps([ Step::make('group selection') ->schema([...
Solution:
depending on what kinda place it is the field name may change
$livewire->addError('mountedActions.0.data.group_id', 'My error!');
$livewire->addError('mountedActions.0.data.group_id', 'My error!');
...

Filament v4 grid , gridDelete and textColor not found in RichEdit

Filament V4 grid , gridDelete and textColor not found in RichEdit toolbar although its found in doc ,...
Solution:
They are there. Are you on the latest version?

OptionStateCast forces casting of option keys to integer

@Dan Harrin Any particular reason why would you force the type to integer? This last update does solve for keys starting with zero, but to be honest I currently don't agree. In my particular case, I have keys in this fashion "0011, 1025, 5568" which I'd like to keep as strings no matter what. Changing the type throughout the application can have side effects. My DB columns is JSON and the values get's stored as string in case of leading zeroes and integer in other cases. I solved this with setting my custom cast with ->stateCasts(), now after this update: https://github.com/filamentphp/filament/pull/17902/files I solved with Cutom Laravel casts, since you keep numbers starting with zero as strings. Not everyone knows this if they don't source dive and will have issues....

<x-filament-panels::resources.relation-managers>

How can I render a relation manager’s UI inside my own custom view in Filament v4 now that the <x-filament-panels::resources.relation-managers> Blade component is no longer available? What’s the recommended way to embed a specific resource’s relation manager in a custom page/view?
Solution:
yah works 😄 thx a lot...

RichEditor and Spatie Media Library

I'm using Spatie media library and it's filament plugin, i followed the instruction on setting up my model aso that i can use it with RichEditor TicketModel: ``` ...

React to Repeater being deleted

Is there a way to react to a repeater item being deleted? I created a custom entry following the documentation here - https://filamentphp.com/docs/4.x/infolists/custom-entries I have the following logic...
Solution:
->partiallyRenderComponentsAfterStateUpdated(['payment_summary'])
->partiallyRenderComponentsAfterStateUpdated(['payment_summary'])
This one work. To me also makes sense that ->delete would trigger afterStateUpdated()....
No description

Navigation click problem

Im from v3 upgraded to v4. My problem is sometimes when i clicked navigation button i doesn't respond. I need to refresh the whole page to make it work. I don't think whats the problem

Table summary

Why the summary is not shown below the summary row: https://filamentphp.com/docs/4.x/tables/summaries ``` TextColumn::make('status')...
No description

Filament not calling reorder action (repeater) on drag&drop

I have a form with a repeater. The repeater reorder is working fine by using the moveUp/moveDown actions but the reorder action fails. MountableAction->call is not called. ...

Help Migrating plugin from V3 to V4

I'm trying to migrate a plugin on github from filament v3 to v4, so far i managed to fix all the imports and change the structure to follow v4 however i'm stuck on finding alternatives for some no longer used blade components from v3. I tried to look around the v4 repository but i didn't find anything close to these. While i could go and grab them and implement them into the plugin i would prefer to use something native to filament so i can keep the functionality and styling consistent with all the future updates. ``` x-filament-tables::empty-state...
Solution:
They were probably all inlined. So it's just HTML + CSS now.

Compact Repeaters

Trying to make Repeaters Compact - https://filamentphp.com/docs/4.x/forms/repeater#compact-table-repeaters However, does not appear if compact exists in Filament\Forms\Components\Repeater?...

RichEditor not working after update to Filament V4

I'm using standard RichEditor and after updating everything from Filament V3 to Filament V4 I'm getting this error in console when I open modal with RichEditor inside and my content doesn't get pasted in, any ideas? Not sure where to even begin figuring this one out. `->schema([...
Solution:
I did solve it, but no idea why. I went to another branch to fix something, went back to the branch where I'm updating to filament v4 and then ran composer update, npm install, npm run build and npm run dev again and now it works.
No description