adnn
adnn
Explore posts from servers
FFilament
Created by adnn on 11/6/2024 in #❓┊help
Flatten data in the Blocks structure?
I want to get rid of the "data" parent in the structure that the Block saves data in eg. [{data: {}, type: "block type"} and instead just have the content of the data directly in the parent alongside the block type what's the recommende way of doing this?
2 replies
FFilament
Created by adnn on 8/4/2024 in #❓┊help
Custom media links in Rich text editor?
I am using the default rich text editor for a basic blog CMS which also requires images in the. However, when you insert an image, it just opens your finder and inserts a link to the image as filament.com/storage/image.jpg This is not ideal because I am serving the images to the frontend through a custom media endpoint, and I need more fine tuned controls over the link i.e. different sizes, thumbs, cache headers, etc. Is there a way to extend the Rich text editor Media uploader to use some sort of Media library and to generate custom links before saving to database? Or is there perhaps a better editor plugin?
2 replies
FFilament
Created by adnn on 7/17/2024 in #❓┊help
Preserve collapsed state in Builder?
Is it possible to add this? in a simmilar way that it preserves which tab was last opened? it's really difficult to work with if you have large amount of builders, and they're all opened at once every time you go to edit the page
2 replies
FFilament
Created by adnn on 7/2/2024 in #❓┊help
Split a Resource Form in multiple sub navigations?
I have a resource that requires a lot of form inputs for various things related to it. I would like to separate the Form into the navigation tabs so instead of having brand/2/edit and listing all fields at once it would be brand/2/edit/content, edit/administration, etc. while using the same model, not a relationship is this possible? if yes what's the proper way to go about it?
6 replies
FFilament
Created by adnn on 5/27/2024 in #❓┊help
Filter button placement?
No description
3 replies
FFilament
Created by adnn on 5/21/2024 in #❓┊help
different getOptionLabelFromRecordUsing for selected items?
Forms\Components\Select::make('website')
->live()
->label('Brand')
// ->required()

->multiple()
->relationship('website', 'name')
->allowHtml()
->getOptionLabelFromRecordUsing(fn (Website $record) =>
"<span class='font-semibold text-md'>{$record->name}</span> <br/>
<span class='text-xs font-light'>{$record->id}&nbsp;{$record->domain}</span>"

)

->searchable(['name', 'domain'])
->preload(),
Forms\Components\Select::make('website')
->live()
->label('Brand')
// ->required()

->multiple()
->relationship('website', 'name')
->allowHtml()
->getOptionLabelFromRecordUsing(fn (Website $record) =>
"<span class='font-semibold text-md'>{$record->name}</span> <br/>
<span class='text-xs font-light'>{$record->id}&nbsp;{$record->domain}</span>"

)

->searchable(['name', 'domain'])
->preload(),
Is it possible to have different html for the currently selected item? For example to only show the name on the Selected item, but show other things when searching items
2 replies
FFilament
Created by adnn on 5/19/2024 in #❓┊help
Use same infolist as page and modal when needed?
I have a resource with a view page infolist. I also want to add an Action in some other panel that would just open a peek infolist modal from that resource, rather than going to the page or having to copy paste the infolist in the action how can i achieve this?
7 replies
FFilament
Created by adnn on 5/15/2024 in #❓┊help
VS Code set up for Filament/Laravel development?
I'm coming from a Typescript react background, so I'm very used to just being able to command click on any type, method, function or whatever and for it to take me to it's definition. Whether it be my own, or something from a package. For example if I have a plugin for Media which has a ->getDefaultFolder(), if I want to find out anything more about what this does, I have to manually search and find it in the vendor folder.
However I can't seem to get this funcionality to work for Laravel and Filament at all. I've installed the Laravel Extension pack but it didn't do anything. There are 2 Filament specific plugins but both seem outdated. Does anyone know if I can do something to achieve the same funcionality as in React projects? I'm on Mac
6 replies
FFilament
Created by adnn on 5/15/2024 in #❓┊help
Baptiste job monitor multi tenancy?
How can I make this plugin work properly with tenants? It keeps saying
The model [Croustibat\FilamentJobsMonitor\Models\QueueMonitor] does not have a relationship named [team]. You can change the relationship being used by passing it to the [ownershipRelationship] argument of the [tenant()] method in configuration. You can change the relationship being used per-resource by setting it as the [$tenantOwnershipRelationshipName] static property on the [Croustibat\FilamentJobsMonitor\Resources\QueueMonitorResource] resource class.
The model [Croustibat\FilamentJobsMonitor\Models\QueueMonitor] does not have a relationship named [team]. You can change the relationship being used by passing it to the [ownershipRelationship] argument of the [tenant()] method in configuration. You can change the relationship being used per-resource by setting it as the [$tenantOwnershipRelationshipName] static property on the [Croustibat\FilamentJobsMonitor\Resources\QueueMonitorResource] resource class.
Usually I'd just add
protected static bool $isScopedToTenant = false;
protected static bool $isScopedToTenant = false;
to the Resource, but this one doesn't have a resource published so I'm not really sure where or how to do it https://filamentphp.com/plugins/croustibat-jobs-monitor
7 replies
FFilament
Created by adnn on 5/8/2024 in #❓┊help
Use a badge text column in ->form?
In my edit and view page i want to display a static item as a badge, is this achievable? Example something identical to this but for the form?
Forms\Components\TextInput::make('platform')
->label('Platform')
->url(fn ($record) => $record->url)
->color(fn (string $state): string => match ($state) {

default => 'gray'
}),
Forms\Components\TextInput::make('platform')
->label('Platform')
->url(fn ($record) => $record->url)
->color(fn (string $state): string => match ($state) {

default => 'gray'
}),
4 replies
FFilament
Created by adnn on 5/3/2024 in #❓┊help
Connecting the media library with entities?
I have a resource for product reviews that lists review, each review might have some images with it. Would it be possible to also have a media library to see all the review images at once, while also keeping the images in a relationship with the review, and assigning them to other reviews if needed? Also can I keep the images in something like google cloud or alike? I was looking at purchasing https://filamentphp.com/plugins/ralphjsmit-media-library-manager but want to ask if this would cover our use case?
2 replies
FFilament
Created by adnn on 4/26/2024 in #❓┊help
Resource not showing up in Roles? Filament shield
I created a new resource, but it's not showing up in shield/roles as a resource? I've ran php artisan shield:generate --all and even did php artisan shield:install and despite a policy existing and showing up in terminal, it's not visible on the filament page itself
| 7 | Taxonomy | TaxonomyPolicy.php :white_check_mark: | view_taxonomy, |
| | | | view_any_taxonomy, |
| | | | create_taxonomy, |
| | | | update_taxonomy, |
| | | | restore_taxonomy, |
| | | | restore_any_taxonomy, |
| | | | replicate_taxonomy, |
| | | | reorder_taxonomy, |
| | | | delete_taxonomy, |
| | | | delete_any_taxonomy, |
| | | | force_delete_taxonomy, |
| | | | force_delete_any_taxonomy :white_check_mark:
| 7 | Taxonomy | TaxonomyPolicy.php :white_check_mark: | view_taxonomy, |
| | | | view_any_taxonomy, |
| | | | create_taxonomy, |
| | | | update_taxonomy, |
| | | | restore_taxonomy, |
| | | | restore_any_taxonomy, |
| | | | replicate_taxonomy, |
| | | | reorder_taxonomy, |
| | | | delete_taxonomy, |
| | | | delete_any_taxonomy, |
| | | | force_delete_taxonomy, |
| | | | force_delete_any_taxonomy :white_check_mark:
what could the cause of this be?
3 replies
FFilament
Created by adnn on 4/16/2024 in #❓┊help
Is it possible to adjust the navigation panel width to be even smaller?
No description
3 replies
FFilament
Created by adnn on 4/15/2024 in #❓┊help
Better performance?
I have employed all the suggestions in https://filamentphp.com/docs/3.x/panels/installation#deploying-to-production however the load times for my tables are still unbelievably long, it feels like it's reading from the database every time a table is show, and even that is still longer than it should be Is there anything that can be done to improve this? Does filament cache the queries? Is there a way to add redis in between? I have a very beefy server on hetzner, the database is on the same server, and even so, a table with barely 200 records, showing only 10 , loads for good 2.7 seconds and I find it unacceptable for production
73 replies
FFilament
Created by adnn on 4/9/2024 in #❓┊help
Filament shield showing Roles managment to everyone
Out of the sudden, my shield/roles managment tab has become accessible to all users instead and the Role policy is not being taken into account? what could've caused this behaviour, i've tried doing php artisan shield:install again but it hasn't fixed it?
6 replies
FFilament
Created by adnn on 4/9/2024 in #❓┊help
Many relationship manager?
In my database I have brands and products I have a resource called Brand, and have tried making a relationship manager for Products. However, on my Brands table I don't have any product ids, because it can have hundreds. my products table has a brand_id column How do i properly set up this relationship in filament? Do I need to create an in between table?
11 replies
FFilament
Created by adnn on 4/8/2024 in #❓┊help
Infolist with pages?
I would like to have a table with infolist, as well as pages? Currently if I add pages for a site, cliking on the row takes me to the edit page. Can i make it so that clicking still opens infolist, but edit button takes you go to edit page?
4 replies
FFilament
Created by adnn on 4/3/2024 in #❓┊help
Call $livewire->js in header actions?
I have this table action which just opens a link with a token, it uses the livewire component to execute javascript because you can't open a link with php. Tables\Actions\EditAction::make(), Action::make('login') ->button() ->color('info') ->label('Log in') ->action(function (Website $website, Component $livewire) { //open wordpress link with token $token = self::generateToken($website->id); if (empty($token)) { Notification::make() ->title('Error: Token Generation Failed') ->danger() ->send(); return ''; } $url = 'https://www.' . $website->domain . '?token=' . urlencode($token); $livewire->js("window.open('{$url}', '_blank');"); i'm trying to have this same action in my edit page header actions, protected function getHeaderActions(): array { return [ Actions\DeleteAction::make(), Actions\Action::make('login') etc etc. ]} however getting various errors App\Filament\Resources\WebsiteResource\Pages\EditWebsite::App\Filament\Resources\WebsiteResource\Pages{closure}(): Argument #2 ($livewire) must be of type App\Filament\Resources\WebsiteResource\Pages\Component, App\Filament\Resources\WebsiteResource\Pages\EditWebsite given, called in vendor/filament/support/src/Concerns/EvaluatesClosures.php on line 35 did i go about this the wrong way, how can i achieve this?
5 replies
FFilament
Created by adnn on 3/25/2024 in #❓┊help
Add a button next to Resource create button?
No description
4 replies