adnn
adnn
Explore posts from servers
FFilament
Created by adnn on 7/2/2024 in #❓┊help
Split a Resource Form in multiple sub navigations?
Wow this is brilliant, thank you so much! Your Filament looks insane, never knew you could customize it that far, super cool
6 replies
FFilament
Created by adnn on 5/27/2024 in #❓┊help
Filter button placement?
nevermind, just had to remove , layout: Tables\Enums\FiltersLayout::AboveContentCollapsible
3 replies
FFilament
Created by adnn on 5/19/2024 in #❓┊help
Use same infolist as page and modal when needed?
I am using it inside the AppServiceProvider, to extend the Ralph Media plugin Basically trying to add a button on each image in the media page, that will quickly open a view modal of it's parent Review, so you can see where each image is used.
public function boot(): void
{
Model::unguard();

MediaLibrary::registerMediaInfoInformationUsing(
function (array $information, MediaLibraryItem $mediaLibraryItem, MediaItemMeta $mediaItemMeta): array {

$reviewIds = DB::table('media_library_item_review')
->where('media_library_item_id', $mediaLibraryItem->getKey())
->pluck('review_id');

$reviewActions = [];

foreach ($reviewIds as $reviewId) {
$reviewActions["Used on ID " . $reviewId] = Actions\Action::make('review')
->badge()

->icon('heroicon-c-link')
->url(fn ($record) => \App\Filament\Resources\ReviewResource::getUrl('view', ['record' => $reviewId]))
->openUrlInNewTab();
}

return array_merge($information, $reviewActions);

});
public function boot(): void
{
Model::unguard();

MediaLibrary::registerMediaInfoInformationUsing(
function (array $information, MediaLibraryItem $mediaLibraryItem, MediaItemMeta $mediaItemMeta): array {

$reviewIds = DB::table('media_library_item_review')
->where('media_library_item_id', $mediaLibraryItem->getKey())
->pluck('review_id');

$reviewActions = [];

foreach ($reviewIds as $reviewId) {
$reviewActions["Used on ID " . $reviewId] = Actions\Action::make('review')
->badge()

->icon('heroicon-c-link')
->url(fn ($record) => \App\Filament\Resources\ReviewResource::getUrl('view', ['record' => $reviewId]))
->openUrlInNewTab();
}

return array_merge($information, $reviewActions);

});
7 replies
FFilament
Created by adnn on 5/19/2024 in #❓┊help
Use same infolist as page and modal when needed?
Thank you, this seems to be what I'm looking for. But how do you properly reference the record from an outside resource? Currently I have this, which is outside the review resource,
Action::make('review')
->badge()
->icon('heroicon-c-link')
->url(fn ($record) => \App\Filament\Resources\ReviewResource::getUrl('view', ['record' => $reviewId]))
->openUrlInNewTab();
Action::make('review')
->badge()
->icon('heroicon-c-link')
->url(fn ($record) => \App\Filament\Resources\ReviewResource::getUrl('view', ['record' => $reviewId]))
->openUrlInNewTab();
7 replies
FFilament
Created by adnn on 5/15/2024 in #❓┊help
Baptiste job monitor multi tenancy?
I added protected static bool $isScopedToTenant = false; to the Resource in the vendor folder directly just to see, and it fixed it, so it seems like just my resource extends is wrong, any ideas about that? I'm not OOP knowledgable
7 replies
FFilament
Created by adnn on 5/15/2024 in #❓┊help
Baptiste job monitor multi tenancy?
Thank you, I really appreciate you helping everyone. I've tried doing that like so, but still getting the same error
<?php

namespace App\Filament\Resources;


use Croustibat\FilamentJobsMonitor\Resources\QueueMonitorResource;


class MyQueueMonitorResource extends QueueMonitorResource
{
protected static bool $isScopedToTenant = false;

}
<?php

namespace App\Filament\Resources;


use Croustibat\FilamentJobsMonitor\Resources\QueueMonitorResource;


class MyQueueMonitorResource extends QueueMonitorResource
{
protected static bool $isScopedToTenant = false;

}
and
<?php

return [
'resources' => [
'enabled' => true,
'label' => 'Job',
'plural_label' => 'Jobs',
'navigation_group' => 'Settings',
'navigation_icon' => 'heroicon-o-cpu-chip',
'navigation_sort' => null,
'navigation_count_badge' => false,
'resource' =>
App\Filament\Resources\MyQueueMonitorResource::class,
'cluster' => null,
],
'pruning' => [
'enabled' => true,
'retention_days' => 7,
],
];
<?php

return [
'resources' => [
'enabled' => true,
'label' => 'Job',
'plural_label' => 'Jobs',
'navigation_group' => 'Settings',
'navigation_icon' => 'heroicon-o-cpu-chip',
'navigation_sort' => null,
'navigation_count_badge' => false,
'resource' =>
App\Filament\Resources\MyQueueMonitorResource::class,
'cluster' => null,
],
'pruning' => [
'enabled' => true,
'retention_days' => 7,
],
];
7 replies
FFilament
Created by adnn on 5/15/2024 in #❓┊help
VS Code set up for Filament/Laravel development?
Haha no way
6 replies
FFilament
Created by adnn on 5/15/2024 in #❓┊help
VS Code set up for Filament/Laravel development?
I have that installed as well
6 replies
FFilament
Created by adnn on 5/8/2024 in #❓┊help
Use a badge text column in ->form?
I suppose in relation to this. I have user profile pictures saved, on a view page I want to just show it and on edit allow it to be changed, is this doable?
4 replies
FFilament
Created by adnn on 4/15/2024 in #❓┊help
Better performance?
No description
73 replies
FFilament
Created by adnn on 4/26/2024 in #❓┊help
Resource not showing up in Roles? Filament shield
nevermind php artisan filament:clear-cached-components fixed it
3 replies
FFilament
Created by Martin Lakrids on 4/19/2024 in #❓┊help
Am I the only one who often lands on V2 Documentation pages?
+1 for this, happens to me often
8 replies
FFilament
Created by adnn on 4/15/2024 in #❓┊help
Better performance?
Unfortunately I've only started using Laravel and Filament recently so am not familiar enough to offer any other concrete suggestions. Perhaps @ctoma's idea is a lot easier and simpler option
73 replies
FFilament
Created by adnn on 4/15/2024 in #❓┊help
Better performance?
How does this work with HTML?
Yeah it'd have to be JS
Hm. It would change the current behaviour though. People expect it to "just work" so we probably can't ship that with v3.
->font('Inter') if font in fonts/ try $url= asset('font') else use default cdn doesn't change any behaviour, and it's prefferable to use the local font if you have it
73 replies
FFilament
Created by adnn on 4/15/2024 in #❓┊help
Better performance?
I don't know enough about Laravel to understand why a new package is needed, can't you just ship files of one default font and import it url('fonts/whatever') or just use system fonts? And then if you use a custom one, you choose a CDN or install it locally yourself and that's it. Bunny has a PoP here in Ljubljana, and it still doesn't work, I've never had issues with Google fonts but I know it comes with a privacy sacrifice. Another solution could be just manually timing out the request instead of waiting, no font should be taking more than a second to load and even that's very high
73 replies
FFilament
Created by adnn on 4/15/2024 in #❓┊help
Better performance?
Haha exactly my point. Every single navigation in Filament would call Bunny font CDN, which was not resolving properly and it was practically unusable because it was waiting for it to timeout before doing anything. Sometimes taking even 10 seconds for a view to load. It was also happening seemingly random, half of my team complained, the other half had no problems, so a pain to debug. I started debugging queries and setups, until it happened to me, as soon as I switched to GoogleFonts, our performance skyrocketed. I'm not joking when I say it's 10x faster. So yes, Filament is fast, but for some reason a font is able to brick it completely. I'd probably just have the Inter shipped as a static font and fallback to it
73 replies
FFilament
Created by adnn on 4/15/2024 in #❓┊help
Better performance?
There's nothing really for me to reproduce, as the issue is with the external CDN and Filament's handling of ->font and not some code I wrote. I already wrote what I found out in as much detail as I can. @awcodes Sure but unless you have a specific reason to do it, you will not take a second look at the ->font which uses Bunny by default and is prominent in the documenation. This was such a pain to debug as it was happening in rare cases, costing us a lot of time for something so trivial. In any case, I think a font CDN of all things should not have such a vital role to the point that it is able to degrade the performance of the entire app, at the very least it should just go back to the default Inter font.
73 replies
FFilament
Created by adnn on 4/15/2024 in #❓┊help
Better performance?
@awcodes @toeknee Hey, I'm tagging you directly because I resolved this and believe the cause might be some sort of bug. Initially my AdminPanel was set up with ->font('Poppins') Which was trying to reach https://fonts.bunny.net/css?family=poppins:400,500,600,700&display=swap For me this endpoint resolves in Firefox, but does not in Chrome or Brave (no blockers of any kind). Filament was waiting for the pending request until it timed out, and only then loaded the pages. When I switched to ->font('Poppins', provider: GoogleFontProvider::class) my performance improved drastically, literally 10x loading speed of tables. In any case, whether the issue is with Bunny, chrome or whatever, I think Filament should not be so hard dependant on an external CDN to the point that it bricks the entire app, especially not for a font of all things. It should fallback on Google fonts if the request is pending for too long. I saw a similar issue from this guy on GitHub, https://github.com/filamentphp/filament/issues/7987 which was rather rudely closed by @Dan Harrin without any consideration.
73 replies
FFilament
Created by adnn on 4/15/2024 in #❓┊help
Better performance?
I'm not using any custom or complex queries, completely barebones setup straight from the documentation with a single Brand model, no relationships, and just a simple table showing 3 columns. That's why I'm so confused by it
73 replies
FFilament
Created by Taz416 on 4/15/2024 in #❓┊help
Multiple search terms
Everything on that site is in the github demo repo, including a working OR filter
11 replies