ConnorHowell
ConnorHowell
FFilament
Created by Jordy on 6/12/2024 in #❓┊help
Issue with Summary Range formatting
In hindsight that makes a lot of sense considering $state was an array to begin with lol
25 replies
FFilament
Created by Jordy on 6/12/2024 in #❓┊help
Issue with Summary Range formatting
Yeah ignore that I was being stupid
25 replies
FFilament
Created by Jordy on 6/12/2024 in #❓┊help
Issue with Summary Range formatting
Try ->numeric(false) on the summarizer?
25 replies
FFilament
Created by soogo on 6/7/2024 in #❓┊help
A calculated column in the table
You should either use the sortable method to customise the way it performs the query, or you should consider using a virtual column on the table https://filamentphp.com/docs/3.x/tables/columns/getting-started#sorting
3 replies
FFilament
Created by Sujal Tamrakar on 4/28/2024 in #❓┊help
Uploading new image to a prefilled spatie media file upload not working in custom page with forms
Could you share the code you're using for the form? It sounds like it's not setup to allow multiple files? https://filamentphp.com/docs/3.x/forms/fields/file-upload#uploading-multiple-files
3 replies
FFilament
Created by malivodka on 4/29/2024 in #❓┊help
How to hide drop down on menus?
Although it seems like you're not really using multi tenancy correctly if you're needing to hide that dropdown?
4 replies
FFilament
Created by malivodka on 4/29/2024 in #❓┊help
How to hide drop down on menus?
4 replies
FFilament
Created by Alnuaimi on 4/29/2024 in #❓┊help
How to add code into main Head in all pages in Filamentphp?
There's 2 ways, you can either register a javascript file on the panel: https://filamentphp.com/docs/3.x/panels/configuration#registering-assets-for-a-panel Or you can register a render hook https://filamentphp.com/docs/3.x/support/render-hooks#registering-render-hooks, you'd want PanelsRenderHook::HEAD_END or PanelsRenderHook::HEAD_START
3 replies
FFilament
Created by Saifulapm on 4/19/2024 in #❓┊help
Using a custom user model in Export action
Yes you'll want to put that in the register() method of a service provider, AppServiceProvider would be a suitable place.
7 replies
FFilament
Created by Imane Ouahmane on 4/18/2024 in #❓┊help
Login and registration API
Take a look at the base classes to understand what is happening with the standard pages
8 replies
FFilament
Created by Imane Ouahmane on 4/18/2024 in #❓┊help
Login and registration API
https://filamentphp.com/docs/3.x/panels/users#customizing-the-authentication-features - Read this section on how you would go about customising the auth features. The example in the docs is on the EditProfile page but you can apply this to both Login & Register pages.
8 replies
FFilament
Created by Harvey on 4/19/2024 in #❓┊help
Custom table columns per table tab
So the filament version of a lens would be using filter tabs on the "ListRecords" page class: https://filamentphp.com/docs/3.x/panels/resources/listing-records#using-tabs-to-filter-the-records On your columns you can use a callback in hidden() to inject $livewire which will give you the instance of ListRecords, you can then use that to check the current tab. Let's say you have the following on the ListRecords page:
public function getTabs(): array
{
return [
'all' => Tab::make(),
'active' => Tab::make()
->modifyQueryUsing(fn (Builder $query) => $query->where('active', true)),
'inactive' => Tab::make()
->modifyQueryUsing(fn (Builder $query) => $query->where('active', false)),
];
}
public function getTabs(): array
{
return [
'all' => Tab::make(),
'active' => Tab::make()
->modifyQueryUsing(fn (Builder $query) => $query->where('active', true)),
'inactive' => Tab::make()
->modifyQueryUsing(fn (Builder $query) => $query->where('active', false)),
];
}
On a table you could do the following to make the 'active' column only show on the all tab:
Tables\Columns\IconColumn::make('active')
->boolean()
->hidden(fn ($livewire) => $livewire->activeTab !== 'all')
Tables\Columns\IconColumn::make('active')
->boolean()
->hidden(fn ($livewire) => $livewire->activeTab !== 'all')
6 replies
FFilament
Created by Yatendra on 4/19/2024 in #❓┊help
Select option Concat
In options you can return any array/collection so you just need to write your own logic in there to get an array of keys/values as you would any other way in PHP/Laravel. You could use mapWithKeys to achieve this, something like this would work:
Select::make('author_id')
->label('Author')
->options(Lead::all()->mapWithKeys(function ($lead) {
return [$lead->id => $lead->lead_name.'-('.$lead->lead_price.')'];
}))
Select::make('author_id')
->label('Author')
->options(Lead::all()->mapWithKeys(function ($lead) {
return [$lead->id => $lead->lead_name.'-('.$lead->lead_price.')'];
}))
10 replies
FFilament
Created by Yatendra on 4/19/2024 in #❓┊help
Select option Concat
What does your code currently look like and what have you tried?
10 replies
FFilament
Created by Yatendra on 4/19/2024 in #❓┊help
Select option Concat
If you're also likely to use that format elsewhere in your app consider adding a virtual column to the table so you can reference it as if it were a regular column
10 replies
FFilament
Created by Sydd on 4/16/2024 in #❓┊help
Disable global search from topbar
It'll be in your panel provider: app/Providers/Filament/AdminPanelProvider for example
10 replies
FFilament
Created by Sydd on 4/16/2024 in #❓┊help
Disable global search from topbar
As soon as you give a resource a title attribute it immediately becomes globally searchable
10 replies
FFilament
Created by Sydd on 4/16/2024 in #❓┊help
Disable global search from topbar
10 replies