Asmit Nepali
Asmit Nepali
FFilament
Created by Asmit Nepali on 6/7/2024 in #❓┊help
Filament file upload issue
I figure it out, This is because of Grammarly Extension
5 replies
FFilament
Created by Asmit Nepali on 6/7/2024 in #❓┊help
Filament file upload issue
Specially this is happing on modal
5 replies
FFilament
Created by Asmit Nepali on 5/17/2024 in #❓┊help
How to make Select field disable to edit but it must send the data.
Still not figuring out
10 replies
FFilament
Created by Asmit Nepali on 6/17/2024 in #❓┊help
How to change the create button label globally ?
Thank you @Vp
5 replies
FFilament
Created by Asmit Nepali on 6/13/2024 in #❓┊help
Action failed notification.
@Karthick K Thanks for the idea. Did you say like this Service Provider:
public function register(): void
{
$this->app->bind(DeleteAction::class, TableDeleteAction::class);
}
public function register(): void
{
$this->app->bind(DeleteAction::class, TableDeleteAction::class);
}
TableDeleteAction:
class TableDeleteAction extends DeleteAction
{
protected function setUp(): void
{
parent::setUp();

$this->action(function ($record) {
try {
$record->delete();
Notification::make()
->success()
->title('Record deleted successfully!')
->send();
} catch (ManuallyFailedException $e) {
Notification::make()
->danger()
->title($e->getMessage())
->duration(5000)
->send();
}
});
}
class TableDeleteAction extends DeleteAction
{
protected function setUp(): void
{
parent::setUp();

$this->action(function ($record) {
try {
$record->delete();
Notification::make()
->success()
->title('Record deleted successfully!')
->send();
} catch (ManuallyFailedException $e) {
Notification::make()
->danger()
->title($e->getMessage())
->duration(5000)
->send();
}
});
}
9 replies
FFilament
Created by Asmit Nepali on 6/14/2024 in #❓┊help
Repeat form components with morphToMany delete previous data and add new data.
Any idea 💡
4 replies
FFilament
Created by Asmit Nepali on 6/13/2024 in #❓┊help
Action failed notification.
@Chrispian I used this but I want it from global level and try to configure like
DeleteAction::configureUsing(function (DeleteAction $deleteAction) {
return $deleteAction->action(function ($record) {
try {
$record->delete();
Notification::make()
->success()
->title('Record deleted successfully!')
->send();
} catch (\Exception $e) {
Notification::make()
->danger()
->title($e->getMessage())
->duration(5000)
->send();
}
});
});
DeleteAction::configureUsing(function (DeleteAction $deleteAction) {
return $deleteAction->action(function ($record) {
try {
$record->delete();
Notification::make()
->success()
->title('Record deleted successfully!')
->send();
} catch (\Exception $e) {
Notification::make()
->danger()
->title($e->getMessage())
->duration(5000)
->send();
}
});
});
But it won't work.
9 replies
FFilament
Created by Asmit Nepali on 6/13/2024 in #❓┊help
Action failed notification.
Any one can help
9 replies
FFilament
Created by Asmit Nepali on 6/4/2024 in #❓┊help
Persist modal text field data after close the modal.
@Leandro Ferreira It works Thank you!
11 replies
FFilament
Created by Asmit Nepali on 6/4/2024 in #❓┊help
Persist modal text field data after close the modal.
Ya I also think about this but it will more reliable if we able to get the current notes from the form components it self rather than fetching from DB
11 replies
FFilament
Created by Asmit Nepali on 6/4/2024 in #❓┊help
Persist modal text field data after close the modal.
@Leandro Ferreira Let's say I set status decline then I have to add description (reason) for that. But the description is fill on the modal, after modal colse I have show that description on the form placeholder
11 replies
FFilament
Created by Asmit Nepali on 6/4/2024 in #❓┊help
Persist modal text field data after close the modal.
Section::make('Submission Status')
->schema([
Select::make('status')
->enum(Status::class)
->live()
->required()
->options(Status::class)
->registerActions([
Action::make('addNoteOnStatusUpdated')
->label(function ($state) {
return Status::from($state)->getLabel();
})
->form([
Textarea::make('description')
->label('Reason')
->required(),
])
->action(function ($record, $data) {
$record->notes()->create([
'description' => $data['description'],
'user_id' => auth()->id(),
]);
}),
])
->default(Status::SUBMITTED)
->afterStateUpdated(function ($livewire, Component $component, $state) {
return $livewire->mountFormComponentAction($component->getStatePath(), 'addNoteOnStatusUpdated');
}),
])->hiddenOn(['create'])
Section::make('Submission Status')
->schema([
Select::make('status')
->enum(Status::class)
->live()
->required()
->options(Status::class)
->registerActions([
Action::make('addNoteOnStatusUpdated')
->label(function ($state) {
return Status::from($state)->getLabel();
})
->form([
Textarea::make('description')
->label('Reason')
->required(),
])
->action(function ($record, $data) {
$record->notes()->create([
'description' => $data['description'],
'user_id' => auth()->id(),
]);
}),
])
->default(Status::SUBMITTED)
->afterStateUpdated(function ($livewire, Component $component, $state) {
return $livewire->mountFormComponentAction($component->getStatePath(), 'addNoteOnStatusUpdated');
}),
])->hiddenOn(['create'])
11 replies
FFilament
Created by Asmit Nepali on 6/1/2024 in #❓┊help
How to show total count of related record on Manage Related Record tab badge ?
Thank You @awcodes
15 replies
FFilament
Created by Asmit Nepali on 6/1/2024 in #❓┊help
How to show total count of related record on Manage Related Record tab badge ?
I found that the RM have one extra query that's why I'm switching to MRR
15 replies
FFilament
Created by Asmit Nepali on 6/1/2024 in #❓┊help
How to show total count of related record on Manage Related Record tab badge ?
Which one is better to manage relation, MRR or RM ?
15 replies
FFilament
Created by Asmit Nepali on 6/1/2024 in #❓┊help
How to show total count of related record on Manage Related Record tab badge ?
The owner record is already there then why should we fetch again. Is there any way to get ownerRecrod, here the getOwnerRecord is not static.
15 replies
FFilament
Created by Asmit Nepali on 6/1/2024 in #❓┊help
How to show total count of related record on Manage Related Record tab badge ?
Anyone have any Idea about this ?
15 replies
FFilament
Created by Asmit Nepali on 6/1/2024 in #❓┊help
How to show total count of related record on Manage Related Record tab badge ?
One solution is like
public static function getNavigationBadge(): ?string
{
return static::getResource()::getModel()::find(request()->route('record'))?->notes->count();
}
public static function getNavigationBadge(): ?string
{
return static::getResource()::getModel()::find(request()->route('record'))?->notes->count();
}
But this is not a good solution
15 replies
FFilament
Created by Asmit Nepali on 6/1/2024 in #❓┊help
How to show total count of related record on Manage Related Record tab badge ?
But I used
ManageRelatedRecords
ManageRelatedRecords
15 replies