Jean Roumeau
Jean Roumeau
FFilament
Created by Jean Roumeau on 7/5/2024 in #❓┊help
Custom logic after import completed
Well. That didn't work. The after doesn't wait for the queue to complete so it is been triggered after the job is enqueued and not after all the jobs have completed.
4 replies
FFilament
Created by Jean Roumeau on 7/5/2024 in #❓┊help
Custom logic after import completed
Good one. Seems obvious. Will try now to see if the method is called after the Bus is finished. Thanks.
4 replies
FFilament
Created by setiawanh on 5/4/2024 in #❓┊help
Action button in View Resource to Show Create Popup based on Relationship Manager
This is an example code I presented. Organization is one of my models which loads the form schema on the getForm() method. You should pass your own resource form schema and model.
8 replies
FFilament
Created by Jean Roumeau on 5/3/2024 in #❓┊help
Validate import before inserting records.
According to docs (https://filamentphp.com/docs/3.x/actions/prebuilt-actions/import#customizing-import-validation-messages) it also says that "the import system will automatically validate the CSV file before it is imported". But ot doesn't seem to work like this.
6 replies
FFilament
Created by Fatih Durmaz on 5/3/2024 in #❓┊help
Dont Reset Field
If you have enabled create and another, then the field will reset. If don't, the field will maintain for default redirect. If the field is not mapped to any model value then it will display default value. Any reason not to use ->relationship() on Select element?
6 replies
FFilament
Created by Tetracyclic on 5/4/2024 in #❓┊help
Elegant handling of 419 expiry
Livewire does it pretty similar though:
function handlePageExpiry() {
confirm("This page has expired.\nWould you like to refresh the page?") && window.location.reload();
}
function handlePageExpiry() {
confirm("This page has expired.\nWould you like to refresh the page?") && window.location.reload();
}
16 replies
FFilament
Created by Topairy on 5/4/2024 in #❓┊help
Help with accessing a record in Filament relation manager
visible() is just the inverse method. But is registered on its own property within the component.
16 replies
FFilament
Created by setiawanh on 5/4/2024 in #❓┊help
Action button in View Resource to Show Create Popup based on Relationship Manager
I don't think you need the url() method. You could just add a Filament\Actions\CreateAction to the headerActions of the view page and load the form for the desired resource. Just remember to also add the model() method with the respective resource model class. I did something similiar but not sure if this suits you:
protected function getHeaderActions(): array
{
return [
Actions\EditAction::make(),
Actions\CreateAction::make()
->form(Organization::getForm())
->model(Organization::class),
];
}
protected function getHeaderActions(): array
{
return [
Actions\EditAction::make(),
Actions\CreateAction::make()
->form(Organization::getForm())
->model(Organization::class),
];
}
8 replies
FFilament
Created by Tetracyclic on 5/4/2024 in #❓┊help
Elegant handling of 419 expiry
16 replies
FFilament
Created by Topairy on 5/4/2024 in #❓┊help
Help with accessing a record in Filament relation manager
I think Filament completely removes the action logic when hidden. See here https://filamentphp.com/docs/3.x/actions/trigger-button#authorization
16 replies
FFilament
Created by Topairy on 5/4/2024 in #❓┊help
Help with accessing a record in Filament relation manager
//...
->actions([
MyCustomAction::make('my-custom-action')
->hidden(fn ($record) => !Filament::auth()->user()->can('doSomething', $record)),
//...
//...
->actions([
MyCustomAction::make('my-custom-action')
->hidden(fn ($record) => !Filament::auth()->user()->can('doSomething', $record)),
//...
Something like this?
16 replies
FFilament
Created by Topairy on 5/4/2024 in #❓┊help
Help with accessing a record in Filament relation manager
Did you try with
$this->getOwnerRecord()
$this->getOwnerRecord()
?
16 replies
FFilament
Created by D2RTECH on 5/4/2024 in #❓┊help
issue with fillrecordusing
Wouldn't a setter on the model fit this better?.
protected function itemLoaned(): Attribute
{
return Attribute::
set: fn (string $value) => ucfirst($value),
);
}
protected function itemLoaned(): Attribute
{
return Attribute::
set: fn (string $value) => ucfirst($value),
);
}
3 replies
FFilament
Created by Jean Roumeau on 12/14/2023 in #❓┊help
Record data not updated after changes on a Livewire component within a Infolist
I think I've already tried that, but will do it again.
21 replies
FFilament
Created by Jean Roumeau on 12/14/2023 in #❓┊help
Record data not updated after changes on a Livewire component within a Infolist
You mean on Section ::make()...?
21 replies
FFilament
Created by Jean Roumeau on 12/14/2023 in #❓┊help
Record data not updated after changes on a Livewire component within a Infolist
And DocumentWorkflow::class is the livewire components which has InteractsWithForm
21 replies
FFilament
Created by Jean Roumeau on 12/14/2023 in #❓┊help
Record data not updated after changes on a Livewire component within a Infolist
getInfolistComponents loads the livewire component:
public static function getInfolistComponents(Document $record, $editMode = true) : array
{
$documentType = $record->documentType;
if ($documentType->workflows()->count() === 0) {
return [];
}

if (!$editMode) {
return self::getInfolistComponentsForView($record);
}

$workflowComponents = [];

foreach ($documentType->workflows as $key => $workflow) {
$workflowComponents[] = Section::make(__($workflow->name))
->icon('heroicon-o-rectangle-group')
->description(function () use ($workflow) { return $workflow->description ?? false; })
->collapsible()
->schema([
Livewire::make(DocumentWorkflow::class, ['record' => $record, 'workflow' => $workflow])
]);
}

return $workflowComponents;
}
public static function getInfolistComponents(Document $record, $editMode = true) : array
{
$documentType = $record->documentType;
if ($documentType->workflows()->count() === 0) {
return [];
}

if (!$editMode) {
return self::getInfolistComponentsForView($record);
}

$workflowComponents = [];

foreach ($documentType->workflows as $key => $workflow) {
$workflowComponents[] = Section::make(__($workflow->name))
->icon('heroicon-o-rectangle-group')
->description(function () use ($workflow) { return $workflow->description ?? false; })
->collapsible()
->schema([
Livewire::make(DocumentWorkflow::class, ['record' => $record, 'workflow' => $workflow])
]);
}

return $workflowComponents;
}
21 replies
FFilament
Created by Jean Roumeau on 12/14/2023 in #❓┊help
Record data not updated after changes on a Livewire component within a Infolist
The select is in a livewire component
...Workflow::getInfolistComponents($this->getRecord()),
...Workflow::getInfolistComponents($this->getRecord()),
21 replies
FFilament
Created by Jean Roumeau on 12/14/2023 in #❓┊help
Record data not updated after changes on a Livewire component within a Infolist
Well, I'm not using that wire:key at all. I've copied the view-record view but I'm using an infolist so that condition is not loaded.
21 replies
FFilament
Created by Jean Roumeau on 12/14/2023 in #❓┊help
Record data not updated after changes on a Livewire component within a Infolist
Was trying to fix this: Uncaught Snapshot missing on Livewire component with id:
21 replies