trovster
Creating a widget returns an error.
I have a widget on my panel and it was working fine. I have bumped composer dependencies, run the upgrade command and cleared views, but I now get an error;
If I follow the stats overview documentation to create a new widget and add it to my dashboard, I get the same error.
8 replies
Image Editor Height/Width
I want to create an image which is a specific size. I defined height (400) and width (270) constants that I am using and I have built the
FileUpload
component like the following. However, after using the image editor, it crops the image incorrectly. It creates an image a few pixels smaller than required! How can I create an image with the exact sizes I want.
7 replies
Hide Actions on RelationManager
I am using
ExampleResource::table($table)
in a RelationManager. This includes all the actions that appear on that resource's table. When I call ->actions()
to add a "DetachAction", this is added correctly. However, I would like a way of removing existing actions or resetting them. I tried the hiddenOn()
behaviour that is available for table columns. Is this possible for actions?9 replies
Extend Component, set optional schema based on flag
I have moved complex schema sections to new classes, which I then include in the resource. In the extended component I set up the schema for fields. This works nicely and I am able to override things such as the heading that was set in the custom component.
I can't work out how to conditionally make visible/hidden components.
```php
// In the resource I want MyCustomSection::make()->heading('Example')->simple();
class MyCustomSection extends Section
{
protected bool $simple = false;
public function simple()
{
$this->simple = true;
}
protected function setUp(): void
{
parent::setUp();
$this
->heading(class_basename(static::class))
->schema([
... //more fields
DatePicker::make('modified')->hidden($this->simple),
]);
}
}
5 replies
Extra modal actions, trigger edit modal action and open link
I have a simple resource that has view and edit screens appearing as modal, using the
->actions()
method. I have added two buttons to the footer of the modal, but I can't work out how to trigger their actions.
I want the “View” button to open the resources' permalink in a new tab. And I want the “Edit” button to open the EditAction
modal action – the getUrl
doesn't work because there is no edit page, just the modal.
3 replies
How do I create an Infolist Link?
I want to add a "download" link to an
ImageEntry
but ->downloadable()
is only available for the FileUpload
form component. For example, the following creates a link, but it's not styled nicely (even though I have some basic classes) and seems a little clunky. It also doesn't appear nicely directly below the ImageEntry
I have used above.
8 replies
Infolist ImageEntry doesn't support `extraAttributes()`
TextEntry supports extra attributes, as documented, but this doesn't seem to work for the ImageEntry component. The following appears on TextEntry component view, but such code is missing from ImageEntry.
2 replies
Testing for Infolist actions (hintAction)
I have a
Filament\Infolists\Components\TextEntry
with a hintAction
. Are there any action test methods for these? I am using ->test(Resource\View::class, ...)
and assertActionExists
works for actions setup in getHeaderActions`. But this fails for those on the infolist components.6 replies
Using contracts resolved in AppServiceProvider
I am trying to use a contract which is resolved in the AppServiceProvider, in the Filament\AdminPanelProvider panel config. But it is not resolved at this point as Filament\AdminPanelProvider seems to be registered first, even though it appears after the main provider in the config/app.php How can I change this order?
20 replies
Using domain causes CORS issues
I have built a brand-new V3 admin using a custom (sub)-domain. However, I get a CORS error when using certain functionality, because JS for them are loaded using
asset()
which looks at the .env APP_URL, which is the main applications URL, not my subdomain. How can I fix this?46 replies