Filament

F

Filament

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

Join

Don't want Create Form to show if No Subscription

I want to show No Subscription notification without showing Create Form when user clicks on Create button in List Page. I have this in create page. I also tried beforeFill but halt gives error. ``` protected function handleRecordCreation(array $data): Model { $data['reference'] = RandomStringGeneratorService::generateRandomString(); $data['member_id'] = Auth::user()->member->id; ...
Solution:
I created custom create action listpage. ``` protected function getHeaderActions(): array { return [ Actions\Action::make('create') ->label('Create Job Seeking Post')...

How can I add a client side error message to FileUpload?

When uploading a file that is either not the correct file type, or larger than 2 megabytes, the light gray "x" icon jiggles, but I'd like to add a client side error message as to why the error occurred. It seems that `->validationMessages()" does not do this. How can I add friednly messages specific to each validation? ```php FileUpload::make('image') ->maxSize(2048)...

Disable editing in table row

Hello everyone. I have a condition that disables the editing method of a record. It is working fine, but I noticed that if I click on other columns in the row it edits normally. Is there a way to disable this editing in the row where editing is disabled? Thanks.

how do you test `extraModalActions`?

example code of table (it works fine in UI). ```php ->actions([ EditAction::make('edit-post') ->iconButton()...
Solution:
solution ```php Livewire::test(ListPost::class) ->loadTable() ->mountTableAction(['edit-post', 'delete-post'], $post)...

Automatically delete Export files

Hi guys! I've started playing around with the Exporter functionality in Filament. Works great in combination with Digital Ocean spaces. I'm wondering how to auto-delete the files from DO after a while, since I don't want to keep them there forever. Anyone struggled with that before?...
Solution:
Just create a scheduled task that grabs the files checks their dates and delete them if they are old enough.

Component to return a json

Is there any component or any way to create a custom one that allows you to group its elements into an array or object, just like the Builder component does?

Limit form edit using role but can make a new form through the getRelation()

I wanna ask how can I limit certain role for editing the forms, but i wanna make sure all roles can make a new form through the getRelation(), thank you guys
No description

Eloquent query using integers not working in Filament context

When using a custom query builder/scope with a scope like this: ``` public function inProject(int $projectId): self {...

Combining Relation Manager table with Parent table

I have the parent resource VehicleMakeResoure and the relation manager VehicleModelsRelationManager. It is working as expected. But how do I show the Vehicle models within the Vehicle Make table as groups? Example:...

login route

when access panel eg admin it will redirect to admin/login how to not redirect it ? when access admin show 404 ? thanks...

Custom Chart Widget

Hello, I'm trying to create a widget that loads dinamicaly a different number of charts, but I couldnĀ“t get javascript code injected. this should work, no? -- nps-chart-widget.blade.php -- ...

Ability to find a panel programmatically

Hello, I'm pretty new to Filament, but I'm currently developing a multitenancy plugin for Laravel and I'm hoping somebody figure out how to achieve an integration between it and Filament. One of the things they want to do is feature lock panels, which I believe we can do with middleware. The other thing they want to do is customise the panel based on the current tenant. Things like the colour etc. Are there lifecycle events for panels? Or, is there a way that we could programatically locate a registered panel and change its settings once the current tenant is identified and set?...

illegal offset type in tests

I have many of my tests fail with the same error, and not sure why. As an example test that is failing, its complaining about the ->test line ```php public function test_missing_fields_when_creating_user(): void...
Solution:
I Finally found it. So basically where im creating the temp users, I have to cast the uuid as a string when creating ```php $user->id = (string) Str::uuid();...
No description

Anyone implemented SAML in a Filament app?

Would appreciate some help.
Solution:
Nevermind, I made a custom middleware and used that, and removed the default authenticate class

Table Caching

Hi guys, does filament support caching whole table? I have tried to cache whole response via middleware but it is not successful, $html does not load. But without filament when i cache whole response it works...

How to order images when using Media Library

Hi, Im using Spatie Media Library and the images are displayed in my form and table in reverse, so the bottom one is ordered 1 and the top one is the last. How can I change this please?...

$tableSearch query string removes leading zero's

When i enter a search term like 100.100 it formats it to 100.1, when i do it with 100.101 it stays the same (what is good). I use this code: `/** * @var ?string...

Need Help, how pass parameters to relation manager?

here my table action ->actions([ Tables\Actions\ViewAction::make()->url(fn($record) => RkupResource::getUrl('view', ['record' => $record->id, 'periode' => Carbon::parse(request()->get('tableFilters')['periode']['date'] ?? now())->endOfMonth()->format('Y-m-d')])), Tables\Actions\EditAction::make()->url(fn($record) => RkupResource::getUrl('edit', ['record' => $record->id, 'periode' => Carbon::parse(request()->get('tableFilters')['periode']['date'] ?? now())->endOfMonth()->format('Y-m-d')])), ])...
Solution:
Solve with this. on resource public static function getRelations(): array { return [...

Wizard dont show fullscreen on desktop

anyone know why this is happening? Why my wizard doesnt full on desktop
No description

No application encryption key has been specified

As the title suggests. Has anyone have this problem? I am wondering why this is occured. I have tried: php artisan clear php artisan optimize:clear...