Filament

F

Filament

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

Join

Get file name from state update call

is there a way to get the origional file? the state object contains the random generated name ```php Forms\Components\FileUpload::make('file') ->label(__('labels.file'))...

Columns\TextInputColumn->type('date') not working as expected

According to the docs, you can use ->type() to pass the HTML types to the text input. While this does allow the input to look like the HTML date picker, it doesn't work functionally. Clicking on the calendar icon doesn't open the picker and trying to change the date manually is buggy when trying to change the year.

cluster navigation -> move to main navigation

thanks for taking the time to look 👋 im looking to move the cluster links to the main navigation rather it create a new nagivation. is this possible?...

Load data after page loads

I have an infolist which displays data from the database. I have one field which pulls data from an API (displays status). I want to load the local data and then add the data from the API when it arrives in order to speed up the page loading. Any ideas please? Mike...
Solution:
It's just a livewire regular stuff, the field should be just lazy loaded

Persist form inputs to query string

You can persist the current step of a wizard (https://filamentphp.com/docs/3.x/forms/layout/wizard#persisting-the-current-step-in-the-urls-query-string) but how would you also persist the already input data to the query string so redirects/refresh etc. would work without losing the data? 🤔
Solution:
You can’t… that would involve storing the data in state for each change. You can set the data in session and fill the form if session data exists. You can also enable disabling leaving page without saving changes in the panel too...

Enum is cast when creating but not editing

I have the following model (simplified) ```php class Config extends Model { protected $casts = [...
Solution:
it seems the issue is on your ->default() it should be ->default(ConfigType::MAPPER->value) you can keep the options(), it is already correct. no enum() needed. ...

Password reset request notification test failing

I'm writing a test for the password reset to check if a password reset link can be requested but it's failing. I'm faking notifications and I'm pretty sure I have the correct component and notification but I'm not sure why it's saying the notification hasn't been sent. User implements CanResetPasswords and FilamentUser, and has the Notifiable trait ```php <?php ...
No description

Filament curator upload error

I always get the following error when i try uploading from the form field, but when i use the resource it works.
Awcodes\Curator\Support\Helpers::getUrl(): Argument #1 ($disk) must be of type string, null given, called in D:\Dev\Projects\Web\ecommerce\vendor\awcodes\filament-curator\src\Models\Media.php on line 70
Awcodes\Curator\Support\Helpers::getUrl(): Argument #1 ($disk) must be of type string, null given, called in D:\Dev\Projects\Web\ecommerce\vendor\awcodes\filament-curator\src\Models\Media.php on line 70
...
No description

BulkAction: an action relating to clicking on items (selecting them).

I have a table with a list of invoices to be paid. I would like to achieve such an effect that when I click on individual items (bulk action), each time I select an item in the window above (placecholder?) the total of items clicked increases. Is this possible?

canAccessPanel() Not being called

I am triying to secure access but my canAccessPanel() is not being called. I am using FilamentUser contract in User. And below is my code. to test i am always retirnung false but i am still able to access panel. I cleared all caches. ``` public function canAccessPanel(Panel $panel): bool { dd('canAccessPanel is being called!'); return false; ...
Solution:
Error was due to using the Custom authentication middleware in all my panels. I had commented out Authenticate::class from all auth middleware. Filament native authenticate middleware calls canAccessPanel() method directly. Whereas I implemented CustomAuthenticate::class and removed filament one which caused and issue. Fix was to include this below peice of code in my CustomAuthentciate. ```$panel = Filament::getCurrentPanel(); abort_if( $user instanceof FilamentUser ? (! $user->canAccessPanel($panel)) :...

Get Schema from Form for createOptionForm()I

Is it possible to get the schema from an exsiting Resource to pass it to createOptionForm() of another resource without reapting yourself or without chaging anything in the origin resoruce? In Filament 2.0 I think there was getSchema() on Form class. Now it's gone. Is there another option?...

mohamedsabil83 filament tinyeditor css not matching display

i'm using TinyEditor as a post editor everything is fine until i send it through api, it seems its css is wrong, not the same as the display when editing

How can I set a default value for a Select field in a Filament form when editing a record?

``` Why is the default value not being set for a multi-select (Select::make()->multiple()) field in Filament, and how can I fix it? SelectColumn::make('status') ->options([...

Modal Issue - No Console Errors

Hey All - I'm wondering if anyone has ever dealt with an issue like in the attached video? Basically the screen goes gray like it thinks the modal has been opened, but nothing appears on the page. Here is the code for the Action: ``` Action::make('customRestaurantSelectionDelete') ->label('')...

How to add button to Datetimepicker?

Hello, I have a datetimepicker added to one of my forms and I am looking to add a button to click when I am done selecting date and time. The default datetimepicker lets us select the date and time and then we have to click away to be able to update the input, also there is an option to close it automatically after date and time selection, but what I need is to add a button to update the input and close the picker. Please let me know is it possible to do so? ...
No description

Section disabled() / notClicable() ? ^^

From what i saw, wizard, tab and even section, if we use disabled() it will disable the elements inside of it. i used collapsed() and disabled(). i was expecting to prevent the user to click and open again the section. Is this even possible? there is any other function to do this?...

SQL Error when saving, no such column

I have 3 resources: FoodMenu, FoodMenuSections, FoodMenuItems. A food menu has many sections and a section has many items. I have the section relation manager and the item relation manager set up. The errors When I save a food menu section with the menu set I get the following error...

Error with spatie media file upload

Hello, I am getting an error with fileupload in my production server. But unfortunately, I am not getting the error in local env. Whenever I try to upload an image file. It says file type not supported on production. On local it works without any issue. There is also a console error which appears from file upload js on page load. ...
Solution:
My bad, I should have updated this thread. The error was due to browser cache. Remember guys, always clear your browser cache after updating filament.
No description

Filamentphp v1

My old project used php7.4 so I used v1. But when I use the page, I can't build the form. Can anyone help me? Tks all...

Formatting Tooltip to return rendered HTML instead of plain text

Hi, I am having an issue with rendering HTML on table column tooltip using accessor. Right now on table tooltip i have this ``` TextColumn::make('current_currency_price_without_discount_formatted')...