Martin Oscar
Martin Oscar
FFilament
Created by Martin Oscar on 2/17/2025 in #❓┊help
ReplicateAction in bulkActions
If i put the following under $table->actions() its fine but not in $table->bulkActions()
ReplicateAction::make()
->excludeAttributes(['author', 'uuid', 'servers_count', 'created_at', 'updated_at'])
->modal(false)
->beforeReplicaSaved(function (Egg $replica) {
$replica->uuid = Str::uuid()->toString();
$replica->name .= ' Copy';
$replica->author = auth()->user()->email;
})
->successRedirectUrl(fn (Egg $replica) => EditEgg::getUrl(['record' => $replica])),
ReplicateAction::make()
->excludeAttributes(['author', 'uuid', 'servers_count', 'created_at', 'updated_at'])
->modal(false)
->beforeReplicaSaved(function (Egg $replica) {
$replica->uuid = Str::uuid()->toString();
$replica->name .= ' Copy';
$replica->author = auth()->user()->email;
})
->successRedirectUrl(fn (Egg $replica) => EditEgg::getUrl(['record' => $replica])),
No error logged it just halts and doesn't replicate the model. 3.2.124
2 replies
FFilament
Created by Martin Oscar on 2/10/2025 in #❓┊help
can getOptionLabelUsing() include html ?
Here's my current code
Select::make('alert')
->label('Alert')
->options([
'info' => '<span class="text-info-600 dark:text-info-500">Info</span>',
'warning' => '<span class="text-warning-600 dark:text-warning-500">Warning</span>',
'danger' => '<span class="text-danger-600 dark:text-danger-500">Danger</span>',
'success' => '<span class="text-success-600 dark:text-success-500">Success</span>',
])
->allowHtml()
Select::make('alert')
->label('Alert')
->options([
'info' => '<span class="text-info-600 dark:text-info-500">Info</span>',
'warning' => '<span class="text-warning-600 dark:text-warning-500">Warning</span>',
'danger' => '<span class="text-danger-600 dark:text-danger-500">Danger</span>',
'success' => '<span class="text-success-600 dark:text-success-500">Success</span>',
])
->allowHtml()
And i wonder if something like that would work ?
Select::make('alert')
->label('Alert')
->options([
'info' => 'Info',
'warning' => 'Warning',
'danger' => 'Danger',
'success' => 'Success',
])
->getOptionLabelUsing(fn ($value, AlertBanner $alertBanner) => printf('<span class="%s">%s</span>', $alertBanner->getColorClasses($value), $value))
->allowHtml()
Select::make('alert')
->label('Alert')
->options([
'info' => 'Info',
'warning' => 'Warning',
'danger' => 'Danger',
'success' => 'Success',
])
->getOptionLabelUsing(fn ($value, AlertBanner $alertBanner) => printf('<span class="%s">%s</span>', $alertBanner->getColorClasses($value), $value))
->allowHtml()
4 replies
FFilament
Created by Martin Oscar on 2/8/2025 in #❓┊help
Resource::getUrl(panel: 'server') still uses the wrong panel in spaUrlExceptions()
No description
15 replies
FFilament
Created by Martin Oscar on 1/26/2025 in #❓┊help
SelectFilter->getOptionLabelFromRecordUsing
No description
5 replies
FFilament
Created by Martin Oscar on 1/6/2025 in #❓┊help
modifyRuleUsing on Repeater
Hey i tried making env_variable unique for each egg->id When there's no variable in db its ok I create a variable with env_variable named "TEST", i hit save its working but if i try to save again without changing anything it thinks that it already exists Here's my branch Thanks in advance
6 replies
FFilament
Created by Martin Oscar on 1/3/2025 in #❓┊help
FormAction runs three times
Hey i tried to switch from showing the token in a Notification to a modal but for some reason it creates 3 tokens like if $action->form() was called more then once also successRedirectUrl doesn't refresh the page as it should Here's my branch Thanks in advance
2 replies
FFilament
Created by Martin Oscar on 12/6/2024 in #❓┊help
"live" headerActions
No description
5 replies
FFilament
Created by Martin Oscar on 10/18/2024 in #❓┊help
use `configureUsing` to avoid repetition
I have many password fields in my application so i'd like to use
class AdminPanelProvider extends PanelProvider
{
public function boot()
TextInput::configureUsing(function (TextInput $component) {
$component->isPassword() && $component->revealable(config('panel.password.revealable'));
}, isImportant: true);
}
class AdminPanelProvider extends PanelProvider
{
public function boot()
TextInput::configureUsing(function (TextInput $component) {
$component->isPassword() && $component->revealable(config('panel.password.revealable'));
}, isImportant: true);
}
Problem is this is the boot function runs BEFORE the component is created i want it to execute after so i don't have to manually add ->revealable(config('panel.password.revealable')) to every TextInput of the password kind.
I tried using
dump($component->isPassword());
dump($component->isPassword());
and it will always return false same goes for
dump($component->getType());
dump($component->getType());
it will always return text even though its a password, email or alphanumeric field. I don't want to make my own component just for passwords cause i want to apply similar edit to other components as well Thanks for your help 🙂
23 replies