F
Filamentβ€’3w ago
maltebaer

global settings not applied on custom entry

hey folks, i try to set some defaults on a infolist text entry, since it is used in many places in my app. my idea is, to create a custom entry class and configure this entry in my AdminPanelServiceProvider's boot method. note: BigBoldEntry extends TextEntry in order to be able to apply this kind of adjustments. the setup works fine, but the adjustments are not applied. do you have any ideas about what the problem might be? or how this behaviour might be achieved differently?
->schema([
// write this
BigBoldEntry::make('full_name'),
// instead of this
TextEntry::make('full_name')
->size(TextEntrySize::Large)
->weight(FontWeight::Bold),
])
->schema([
// write this
BigBoldEntry::make('full_name'),
// instead of this
TextEntry::make('full_name')
->size(TextEntrySize::Large)
->weight(FontWeight::Bold),
])
public function boot()
{
BigBoldEntry::configureUsing(function (BigBoldEntry $entry): void {
$entry
->size(TextEntrySize::Large)
->weight(FontWeight::Bold);
});
}
public function boot()
{
BigBoldEntry::configureUsing(function (BigBoldEntry $entry): void {
$entry
->size(TextEntrySize::Large)
->weight(FontWeight::Bold);
});
}
Solution:
okay, sometimes writing it down helps already 😁 the issue is, that i was using the default view in my custom entry class. swapping to filament's 'filament-infolists::components.text-entry' view applied the styles. ```php <?php ...
Jump to solution
1 Reply
Solution
maltebaer
maltebaerβ€’3w ago
okay, sometimes writing it down helps already 😁 the issue is, that i was using the default view in my custom entry class. swapping to filament's 'filament-infolists::components.text-entry' view applied the styles.
<?php

namespace App\Infolists\Components;

use Filament\Infolists\Components\TextEntry;

class BigBoldEntry extends TextEntry
{
// protected string $view = 'infolists.components.big-bold-entry';
protected string $view = 'filament-infolists::components.text-entry';
}
<?php

namespace App\Infolists\Components;

use Filament\Infolists\Components\TextEntry;

class BigBoldEntry extends TextEntry
{
// protected string $view = 'infolists.components.big-bold-entry';
protected string $view = 'filament-infolists::components.text-entry';
}
Want results from more Discord servers?
Add your server