Tieme
Import, before action
Hi All,
I'm trying to import a CSV, the problem with the CSV is that there are no identifiers for updating a record.
Now i'm looking for a action before the importer runs to remove all data already availible in the DB so the new data will be leading and old data is remove.
Is there any action or function for this or do i need to modify the
Filament\Actions\Imports\Jobs\ImportCsv
job?
If i need to change the ImportCsv job, where do i need to add the remove from DB in following function (https://github.com/filamentphp/filament/blob/56a175a12909e8c76c423a50c90c1d507493d2e4/packages/actions/src/Imports/Jobs/ImportCsv.php#L62-L125).
Thanks for any help!3 replies
Apply ->translateLabel() everywhere
Hi All,
Is it possible to apply
->translateLabel()
on every Entry/Column in Forms, Tabel and Infolist?
I need to translate everything but don't want to add the field manual.
I thought of overwriting the Trait and set the Boolean protected bool $shouldTranslateLabel = false;
to true. But what i know it is not possible to overwrite Traits like Classes in Laravel.
Any help would be appreciated.
Thanks5 replies
2 "save" actions on CreateResource with "mutateFormDataBeforeCreate"
Hi All,
I'm aware that actions can be added to a Resource. I would like to add an additional "Save" button on the CreateResource page. My goal is to mutate one parameter (e.g., $data['status'] = InternalStatus::CONCEPT) only when this new button is pressed.
Does anyone have any ideas on how to achieve this?
Thanks in advance!
11 replies
Relationmanager in Livewire Infolist component
Hi All,
I'm trying to get a realtionmanager in a infolist livewire component.
When i do this i get following error.
Is there anyway to do this without defining it in the below function on the resource?
The reason i don't want to have it in below function is that the Infolist has tabs lay-out and need the table in one of the tabs.
I know i can make my own livewire component, but a relationmanager has all the functions that i need.
Thanks for you help.
9 replies
Register Form with Relations
Hi All,
I am making a custome register form just like the documents (https://filamentphp.com/docs/3.x/panels/users#customizing-the-authentication-features)
Here is my complete code for the register form (https://gist.github.com/sitenzo/e30e85cabad4020097eed43c3ca51fad)
I want to create a new user with relations on register, only the user is created without any relationship records.
This is my user model
Does anyone know if this is possible and if so, what am i overlooking?
Thanks for the support, if you need anymore information i can provide it.
6 replies
Enum select with live() on Create and Edit form
Hi All,
I have a question, i use a select with Enum and some dependecie fields/fieldset on this value.
The fieldset
On create record this works, on edit record this works not.
That is because on create
$get('row_type')
is Enum and on Edit it is integer even tho i cast it in the model
For now i have create a helper to get this to work.
This is how i use it now
It works, but i think there is a better and simpler solution only dont know how.
Can anyone point me in the right direction?
Thanks7 replies
Livewire form as widget
Hello Everyone,
I'm currently using the Filament Spatie Settings plugin (https://filamentphp.com/plugins/filament-spatie-settings) and have created a Livewire form based on the guidelines found here: https://filamentphp.com/docs/3.x/forms/adding-a-form-to-a-livewire-component. This was necessary as there wasn't a ready-made Form widget available for this purpose.
My goal now is to integrate this Livewire form into a new page that will also include several table widgets. The idea is to have a single page that aggregates all data from one API source.
Could anyone guide me on how to embed a Livewire form into a page as a widget? Is such integration feasible?
Thank you for your assistance
2 replies
Error on creating resource with custom --model-namespace
Hi All,
I want to create a resource with following command
php artisan make:filament-resource Customer --generate --soft-deletes --view --model-namespace=App\\Models\\Team
as documented here https://filamentphp.com/docs/3.x/panels/resources/getting-started#specifiying-a-custom-model-namespace
This throws me a Fatal error :
How can i handle custom model namespace ?
i already have tried --model-namespace=App\\Models\\Team\\Customer
this wil create the resource, only not generate all the fields for me and also namespace is wrong.4 replies
static values Table / Infolist/ DateTimePicker based on locale
Hi All,
There are some static values in the Table / Infolist/ DateTimePicker class.
If i set them in AppServiceProvider the values change with my options.
Example settings
I want to change these values based on current locale from user.
I use this plugin to add local to dashboard.
https://filamentphp.com/plugins/bezhansalleh-language-switch
I created a Middleware to set these settings.
In the Middleware i have the correct locale.
Now the problem is that these values are not set, and only the default in the classes are set.
This is my complete Middleware : https://gist.github.com/sitenzo/4b357ab20284e1bf79bd3e5eef994036
How can i set these values based on locale?
Thanks
7 replies
Better way to manage default formats?
Hi All,
I use filament with different locals.
Some default dateformats are defined in following classes
At this moment i'm changing the formats of these configurations in AppServiceProvider (Code below)
Now i want to know if there is a better way to manage these settings, this because when filament updates some additional $defaults can be added that are not in my AppServiceProvider
Url to code : https://gist.github.com/sitenzo/a29807e72d38310a5a04f18e3d99f0dd
6 replies
EditTenantProfile in Navigation
Hi All,
I have Multi-tenancy and i can change my tenant information from the tenant menu
Now i want to change the location of this menu item to the Sidebar Navigation (below my Dashboard page)
When i add
I get following error
I also get this error is i add it in panel like
Is it possible to change the location of the Tenant edit profile.
Below is my complete page code for
Thanks for the help
4 replies
Minimal Theme install?
Hi,
I just preorderd the Minimal Theme.
When i want to install after i added to composer.json
and executed the following command
i get following error
How can i solve this problem?
Is it also possible to get Github Repo acces?
Thanks
26 replies
Table groups change default sort
I have a table with groups, the groups is a date group.
I want to hide the settings because it is only one group, that works.
Now i want to change the default sort of the group from asc to desc
The
defaultSort
on the table does not work, how can i set this on the group?
Below is my table,
i cant find any defaultSort
on the Group::make
5 replies
Table defaultGroup 'date' format datetime
Hi All,
I'm grouping my records by date with
Is there a possability to format the date display because it shows as Date: 2023-11-25 00:00:00 and want it to be Date: Saturday 25 November 2023?
For now my solution is below, but there will be added extra selects for the group that i dont want.
And als the defaultSort is not working if i apply the group, how can i sort the records with groups?
4 replies
Table groups, summaries table but not groups.
Hi All
What I am trying to do:
I want to summaries in the Table like https://filamentphp.com/docs/3.x/tables/summaries
In my Table i use Groups when i summaries, the Groups also summaries
My question:
Can i use summaries where table has groups but not summaries the groups?
Thanks for the time and possible response on my question
4 replies
Add ID to modal
Hi All,
I have a action that will open a slideover() modal.
Is there anyway to add a ID to the modal?
I need to change the padding of modalContent in this modal and some other styling within this modal.
i know there is but this will only apply to the Action button.
Or is it possible to open a view where the modal is in?
I did not find anything in https://filamentphp.com/docs/3.x/actions/modals
Thanks for reading this question.
5 replies
Custom summaries (Sum of other column)
Hi All,
I'm looking at https://filamentphp.com/docs/3.x/tables/summaries#custom-summaries
For a summary of a different column.
I have a table where i show Hours. Only Hours is a attribute in de model and not a column in the tabel. So when i want to Sum the "hours" i get a error 500 that the query is bad.
Now i want to summarize this column only with the real column in the database in this case the column is amount that needs to sum.
With below settings that i got from Custom summaries the summory wont show anythin it doe not pop-up nor does it gives me a error.
'''
TextColumn::make('hours')
->sortable()
->summarize(
Summarizer::make()
->label('First last name')
->using(fn (Builder $query): string => $query->sum('amount'))
),
'''
Does anyone know how to summarize a different column than the original one?
Thanks.
2 replies
Relation manager (Hide Table data from table record)
Hi All,
I use the table of the (in my case) ProjectResource.
In that table i want to hide one or 2 columns in the relation manager table.
Example of table.
The first Stack::make (with company.companyname and contact.full_name) needs to be vissible on the "ProjectResource" but Hidden in RalationsshipManager
return $table
->columns([
Split::make([
Stack::make([
TextColumn::make('company.companyname')
->weight(FontWeight::Bold)
->searchable(),
TextColumn::make('contact.full_name'),
])->grow(false),
Stack::make([
TextColumn::make('subject')
->weight(FontWeight::Bold)
->searchable(),
TextColumn::make('number')
->searchable()
->sortable(),
])->grow(false),
4 replies