Ben
Ben
FFilament
Created by lupoz on 12/7/2023 in #❓┊help
live method trim himself
I think you need reactive()
8 replies
FFilament
Created by Ben on 9/14/2023 in #❓┊help
Action modal registered using render hook not trigger the modal
I didn't try it on the latest version yet, maybe later I'll give one more try
11 replies
FFilament
Created by Ben on 9/14/2023 in #❓┊help
Action modal registered using render hook not trigger the modal
Yes, also this Action::make(‘addLink’) and CreateAction::make(‘addLink’)
11 replies
FFilament
Created by Ben on 9/14/2023 in #❓┊help
Action modal registered using render hook not trigger the modal
No description
11 replies
FFilament
Created by Ben on 9/14/2023 in #❓┊help
Action modal registered using render hook not trigger the modal
Sorry for late response. Yes, I did
<div>
{{ $this->addLinkAction }}

<x-filament-actions::modals />
</div>
<div>
{{ $this->addLinkAction }}

<x-filament-actions::modals />
</div>
11 replies
FFilament
Created by erdiegoant on 8/27/2023 in #❓┊help
Create tenant page breaks if we have a custom profile page
Yes, that slug property. try to comment it then go to register tenant
18 replies
FFilament
Created by erdiegoant on 8/27/2023 in #❓┊help
Create tenant page breaks if we have a custom profile page
Need to see the EditTeamProfile code, it looks like your custom edit profile tenant page misconfigured the route, make sure you extend the correct class here Filament\Pages\Tenancy\EditTenantProfile
18 replies
FFilament
Created by geisi1909 on 8/2/2023 in #❓┊help
Is there a way to conditionally hide the Tenant Registration Link in the Tenant Menu?
Oh I'm sorry, I was misread your issue.
37 replies
FFilament
Created by geisi1909 on 8/2/2023 in #❓┊help
Is there a way to conditionally hide the Tenant Registration Link in the Tenant Menu?
In the registration tenant page class, override the parent mount() method. I just did this recently
class RegisterTeam extends RegisterTenant
{
public function mount(): void
{
parent::mount();

if (false) { // your condition checking
$this->redirectRoute('some fallback route');
}

// or abort on certain condition
abort_if(false, 403, 'You don\'t have access to create tenant');
}

public static function getLabel(): string
{
return 'Register team';
}

public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name')->required(),
...
]);
}
}
class RegisterTeam extends RegisterTenant
{
public function mount(): void
{
parent::mount();

if (false) { // your condition checking
$this->redirectRoute('some fallback route');
}

// or abort on certain condition
abort_if(false, 403, 'You don\'t have access to create tenant');
}

public static function getLabel(): string
{
return 'Register team';
}

public function form(Form $form): Form
{
return $form
->schema([
TextInput::make('name')->required(),
...
]);
}
}
37 replies
FFilament
Created by Ben on 6/11/2023 in #❓┊help
Reactive field and afterStateUpdated is not update in realtime on Forms\Components\TextInput\Mask
Thanks a lot, Dan!
6 replies
FFilament
Created by Ben on 6/11/2023 in #❓┊help
Reactive field and afterStateUpdated is not update in realtime on Forms\Components\TextInput\Mask
Oh that's good idea. Using the TextInput instead of Mask, right?
6 replies
FFilament
Created by Ben on 6/10/2023 in #❓┊help
Modal action unexpectedly reset some livewire props value on custom page
Hey Dan! it's solved now. I'm using the livewire listeners to do that. Thanks for your response! ->after(fn ($livewire) => $livewire->emitSelf('shouldLoadItems'))
9 replies
FFilament
Created by Ben on 6/10/2023 in #❓┊help
Modal action unexpectedly reset some livewire props value on custom page
public function loadItems(): void
{
$this->items = $this->order->refresh()->loadMissing(['items.product.media'])->items;

$this->total = $this->items->transform(function (OrderItem $item) {
$item->total = ($item?->amount * $item?->product?->getRawOriginal('selling_price'));

return $item;
})->sum('total');
}
public function loadItems(): void
{
$this->items = $this->order->refresh()->loadMissing(['items.product.media'])->items;

$this->total = $this->items->transform(function (OrderItem $item) {
$item->total = ($item?->amount * $item?->product?->getRawOriginal('selling_price'));

return $item;
})->sum('total');
}
It was not specifically on cancel, it also happened on confirm. for example I click the confirm in the video above
9 replies
FFilament
Created by Ben on 6/10/2023 in #❓┊help
Modal action unexpectedly reset some livewire props value on custom page
Thanks for quick response Dan! I was also tried using ->after(fn ($livewire) => $livewire->loadItems()). It loads the items for a second but then it got reset again
9 replies
FFilament
Created by Ben on 6/10/2023 in #❓┊help
Modal action unexpectedly reset some livewire props value on custom page
Here is the code snippets
public Collection $items;

protected function getActions(): array
{
return [
Actions\Action::make('cancel')
->action(function () {
dd('action');
})
->disabled($this->items->isEmpty())
->label(__('Cancel'))
->color('danger'),
Actions\Action::make('hold')
->action(function () {
dd('action');
})
->disabled($this->items->isEmpty())
->label(__('Hold'))
->color('secondary'),
Actions\Action::make('other')
->label(__('Additional'))
->color('secondary')
->modalSubheading('')
->form([
Forms\Components\Grid::make(1)->schema([
Forms\Components\TextInput::make('description')
->label(__('Keterangan')),
Forms\Components\TextInput::make('amount')
->label(__('Amount')),
]),
])
->action(function ($data, $livewire) {
dd('');
})
->centerModal()
->modalWidth('sm')
->modalCancelAction(function () {
$this->loadItems();

return;
}),
Actions\Action::make('pay')
->action(function () {
dd('action');
})->color('primary')
->disabled($this->items->isEmpty())
->label(__('Pay'))
->extraAttributes(['class' => 'col-span-3']),
];
}
public Collection $items;

protected function getActions(): array
{
return [
Actions\Action::make('cancel')
->action(function () {
dd('action');
})
->disabled($this->items->isEmpty())
->label(__('Cancel'))
->color('danger'),
Actions\Action::make('hold')
->action(function () {
dd('action');
})
->disabled($this->items->isEmpty())
->label(__('Hold'))
->color('secondary'),
Actions\Action::make('other')
->label(__('Additional'))
->color('secondary')
->modalSubheading('')
->form([
Forms\Components\Grid::make(1)->schema([
Forms\Components\TextInput::make('description')
->label(__('Keterangan')),
Forms\Components\TextInput::make('amount')
->label(__('Amount')),
]),
])
->action(function ($data, $livewire) {
dd('');
})
->centerModal()
->modalWidth('sm')
->modalCancelAction(function () {
$this->loadItems();

return;
}),
Actions\Action::make('pay')
->action(function () {
dd('action');
})->color('primary')
->disabled($this->items->isEmpty())
->label(__('Pay'))
->extraAttributes(['class' => 'col-span-3']),
];
}
9 replies
FFilament
Created by Ben on 5/31/2023 in #❓┊help
Widgets above relations manager
Thanks, I'll try it
3 replies