nanopanda
nanopanda
FFilament
Created by TranceCode on 11/13/2024 in #❓┊help
Insert import and export button here!
No description
3 replies
FFilament
Created by Arjan on 10/24/2024 in #❓┊help
Searchable MorphTo
Having a relation named 'model' seems like it might break something, or at the very least be confusing. I'm not sure on your specific error here, but you can pass a closure to searchable() and override the query to search specific columns of your MorphTo models.
->searchable( query: fn ( $query, string $search)
=> $query
->orWhereMorphRelation(
relation: 'somethingable',
types:[Project::class],
column:'title',
operator:'like',
value:"%{$search}%"
)
->orWhereMorphRelation(
relation: 'somethingable',
types:[Party::class],
column:'name',
operator:'like',
value:"%{$search}%"
)
)
->searchable( query: fn ( $query, string $search)
=> $query
->orWhereMorphRelation(
relation: 'somethingable',
types:[Project::class],
column:'title',
operator:'like',
value:"%{$search}%"
)
->orWhereMorphRelation(
relation: 'somethingable',
types:[Party::class],
column:'name',
operator:'like',
value:"%{$search}%"
)
)
5 replies
FFilament
Created by loco on 10/18/2024 in #❓┊help
Grouping Rows with Closure/Tree relation
I'm not sure how getKeyFromRecordUsing functions internally, but based on your output it looks like it's still doing the actual group partitioning based on the "name" attribute of the product. I think you would need to make the attribute passed in to Group::make() an actual relation, like "parent.name" for the DB query to be output correctly.
6 replies
FFilament
Created by Xavi on 10/10/2024 in #❓┊help
Full page loading
@Dennyvik Hmm, have you traced why the modal takes so long to display? I tested a similar column Action structure to your code above, without your $record logic. The modal works normally, and if I add some very slow filters to my table, then the spinner will show correctly before the modal is displayed. Did you add the RenderHook on PanelsRenderHook::FOOTER in your PanelProvider? Any custom theme styles that might conflict?
19 replies
FFilament
Created by Xavi on 10/10/2024 in #❓┊help
Full page loading
@Dennyvik why does your modal form take so long to load? Is there large query populating a Select field or some other heavy Livewire action? Post some code and I can maybe try to test
19 replies
FFilament
Created by Xavi on 10/10/2024 in #❓┊help
Full page loading
@Xavi I just hacked up the markup from the example: <div x-cloak x-show="$store.isLoading.value" class="h-screen w-screen fixed bg-gray-950/50 left-1/2 -translate-x-1/2 z-[6000001]" > <div class="absolute top-1/2 -translate-y-3/4 left-1/2"> <h2 class="text-center text-gray-400 font-bold text-2xl">Loading...</h2> <x-filament::loading-indicator class="w-72 h-72 text-center" /> </div>
19 replies
FFilament
Created by Xavi on 10/10/2024 in #❓┊help
Full page loading
@Dennyvik hmm, I'm not sure. It works for me site-wide on any Action that triggers Livewire 'commit' events. What does your TextColumn->url() code look like?
19 replies
FFilament
Created by Xavi on 10/10/2024 in #❓┊help
Full page loading
@Dennyvik Have you successfully implemented what's outlined in the link above from Lara Zeus? You can adjust the timeout setting on line 21 of the blade.
19 replies
FFilament
Created by agaitan026 on 10/9/2024 in #❓┊help
table inside tabs its possible?
I may be wrong, but your top level tabs seem to more of a top Navigation? In that case you can use ->topNavigation() on your Filament PanelProvider to get a similar effect, although I think the default sidebar nav is more flexible and generally a better approach for a Filament app. Also, while you can likely achieve something close to your screenshot by creating custom Pages and a blade template wrapper, it will probably take a lot more work to get there vs. leveraging the UX of Filament's built-in layout + components.
35 replies
FFilament
Created by Xavi on 10/10/2024 in #❓┊help
Full page loading
@Xavi I recently implemented the example from Lara Zeus (many thx!!) and it works great. I set the timeout at 1500ms and changed the markup so that the spinner is center screen and masks the entire window from additional clicks.
19 replies
FFilament
Created by nowak on 10/7/2024 in #❓┊help
How to avoid showing all widgets on all dashboard pages?
@nowak FWIW, my app has a main dashboard and 4 additional dashboards grouped under an "Analytics" navigationGroup. The analytics dashboards have their own collections of widgets that have specific filter form criteria and are tailored to specifc types of data / Models. All you really need to do is override the getWidgets() method in your Dashboard classes to include only the widgets that you want. If you want Shield permssions for individual widgets ( not just the Dashboard pages ) then you'll still need to register all of them in your panel provider. I also have my Models ( and their Policies ) in sub-folders by functional area, with Resources and Widgets following the same structural pattern.
38 replies
FFilament
Created by raissa_black on 10/2/2024 in #❓┊help
SelectFilter doesn't working
The name passed to make() should be the column name. See below in the docs. Also, options() expects an array, so if you have an enum you may need a method to convert the cases like this: public static function filterOptions(): array { return array_column(self::cases(), "value", "name"); } "Select filters do not require a custom query() method. The column name used to scope the query is the name of the filter. To customize this, you may use the attribute() method:"
6 replies
FFilament
Created by Wannes on 1/12/2024 in #❓┊help
SPA mode in Safari
@awcodes interesting! Yes thanks, that is exactly the issue.
6 replies
FFilament
Created by Wannes on 1/12/2024 in #❓┊help
SPA mode in Safari
@Wannes did you ever solve this? I'm seeing the same issue
6 replies
FFilament
Created by Daniel on 8/29/2024 in #❓┊help
Call to undefined method App\Models\User::buildings()
@Daniel (from Brazil) check out these statics on your RelationManager class:
protected static ?string $relationship
protected static ?string $inverseRelationship
protected static ?string $relationship
protected static ?string $inverseRelationship
3 replies
FFilament
Created by ingmontoya on 12/20/2023 in #❓┊help
navigationParentItem
@Mikail yep, that's why I put "child" in quotes... it's a confusing config for sure.
20 replies
FFilament
Created by ddoddsr on 8/25/2024 in #❓┊help
summarize calculated fields in footer
@ddoddsr In your case I think you are already storing the percentage of sample size ( Connect ) and Sample size ( Request ). So can change the Summarizer ->using() function to something like:
->using(function($query) {
return ( $query->sum('connected') / $query->sum('connection_request') ) * 100;
})
->using(function($query) {
return ( $query->sum('connected') / $query->sum('connection_request') ) * 100;
})
See here also: https://www.omnicalculator.com/math/average-percentage
14 replies
FFilament
Created by ddoddsr on 8/25/2024 in #❓┊help
summarize calculated fields in footer
@ddoddsr gotcha, I'm not a math expert, but if you are using a Average Percentage formula like: [(Percentage 1 + Percentage 2 ... + Percentage N) / (Sample size 1 + Sample size 2 ... + Sample size N )] x 100 Then I suppose you would need two virtual columns for storing the percentages and sample sizes. Then I think you could make your Summarizer ->using() function perform the final calculation like:
return ( $query->sum('percentages') / $query->sum('sample_sizes') ) * 100
return ( $query->sum('percentages') / $query->sum('sample_sizes') ) * 100
14 replies
FFilament
Created by ddoddsr on 8/25/2024 in #❓┊help
summarize calculated fields in footer
You can't accomplish it that way. A custom Summarizer can modify the $query with an aggregate calculation function ( passed to DB ), but it can't perform in-memory calculations for each record. The calculated columns only work because they can run for only the visible records after the query is fetched.
14 replies
FFilament
Created by MAF on 8/26/2024 in #❓┊help
I want to generate dynamic ExportColumn!
Yes, you can access $record in the ->formatStateUsing closure. For example:
ExportColumn::make('tags')
->formatStateUsing( function (Customer $record ): string {
return $record->tags?->pluck('name')->implode(',');
}),
ExportColumn::make('tags')
->formatStateUsing( function (Customer $record ): string {
return $record->tags?->pluck('name')->implode(',');
}),
2 replies