Manuk Minasyan
Manuk Minasyan
FFilament
Created by Manuk Minasyan on 3/25/2025 in #❓┊help
Handling Eloquent Query Builder Serialization Securely Between Components
@awcodes Thank you very much for the suggestions! The Locked attribute is definitely helpful for regular properties, but unfortunately doesn't solve the entire issue with query builders since the concern is both exposure of sensitive query details (even if they can't be modified) and serialization of complex queries. I appreciate you thinking through this with me! Your suggestions about policies and different approaches have given me some good perspectives on tackling this problem.
16 replies
FFilament
Created by Manuk Minasyan on 3/25/2025 in #❓┊help
Handling Eloquent Query Builder Serialization Securely Between Components
Beyond security, serializing complex queries is often problematic: Size concerns: Large queries with many joins/constraints create bloated payloads Compatibility issues: Custom query macros, custom query packages, closures, or scopes often can't be properly serialized
16 replies
FFilament
Created by Manuk Minasyan on 3/25/2025 in #❓┊help
Handling Eloquent Query Builder Serialization Securely Between Components
The issue with synthesizers is they would serialize query information to the client, including: 1. Query constraints like user_id = 1 visible in browser dev tools 2. Database structure and business logic exposure I'm uncomfortable exposing this data client-side. While policies would still protect data access, I prefer not revealing our filtering logic at all.
16 replies
FFilament
Created by Manuk Minasyan on 3/25/2025 in #❓┊help
Handling Eloquent Query Builder Serialization Securely Between Components
I think on this case end user can modify the input params. Task::query()->where('user_id', auth()->id)
16 replies
FFilament
Created by Manuk Minasyan on 3/25/2025 in #❓┊help
Handling Eloquent Query Builder Serialization Securely Between Components
No description
16 replies
FFilament
Created by Manuk Minasyan on 1/13/2025 in #❓┊help
How to pass a section_id parameter to a action when creating a record?
I will try it. Thank you
12 replies
FFilament
Created by Manuk Minasyan on 1/13/2025 in #❓┊help
How to pass a section_id parameter to a action when creating a record?
Are you mean create different component for this purpose? Am I right?
12 replies
FFilament
Created by Manuk Minasyan on 1/13/2025 in #❓┊help
How to pass a section_id parameter to a action when creating a record?
How to do this? I couldn't find anything in the documentation. When I use action without form, this is simple to pass arguement and get it, but with forms this is difficult. in ->action method how to get form data and arguments that I passed from the view?
12 replies
FFilament
Created by Manuk Minasyan on 1/13/2025 in #❓┊help
How to pass a section_id parameter to a action when creating a record?
@foreach ($this->sections as $section)
<x-filament::section x-sortable-item="{{ $section['id'] }}" compact>
<x-slot name="footerActions">
<x-filament::button size="sm" wire:click="mountAction('createFieldAction', { sectionId: 12345 })">
Create field
</x-filament::button>
</x-slot>
</x-filament::section>
@endforeach
@foreach ($this->sections as $section)
<x-filament::section x-sortable-item="{{ $section['id'] }}" compact>
<x-slot name="footerActions">
<x-filament::button size="sm" wire:click="mountAction('createFieldAction', { sectionId: 12345 })">
Create field
</x-filament::button>
</x-slot>
</x-filament::section>
@endforeach
12 replies
FFilament
Created by Manuk Minasyan on 1/13/2025 in #❓┊help
How to pass a section_id parameter to a action when creating a record?
public function createFieldAction(): Action
{
return Action::make('createField')
->size(ActionSize::ExtraSmall)
->label('Create Field')
->form(function(){
return [
Forms\Components\TextInput::make('name')
->required()
->live(onBlur: true)
->maxLength(50),
];
})
->fillForm([
'entity_type' => $this->currentEntityType,
])
->mutateFormDataUsing(function (array $data): array {
if (Utils::isTenantEnabled()) {
$data[config('custom-fields.column_names.tenant_foreign_key')] = Filament::getTenant()?->id;
}

$data['custom_field_section_id'] = null; // I need add section_id here

return $data;
})
->action(fn(array $data) => CustomField::create($data))
->slideOver();
}
public function createFieldAction(): Action
{
return Action::make('createField')
->size(ActionSize::ExtraSmall)
->label('Create Field')
->form(function(){
return [
Forms\Components\TextInput::make('name')
->required()
->live(onBlur: true)
->maxLength(50),
];
})
->fillForm([
'entity_type' => $this->currentEntityType,
])
->mutateFormDataUsing(function (array $data): array {
if (Utils::isTenantEnabled()) {
$data[config('custom-fields.column_names.tenant_foreign_key')] = Filament::getTenant()?->id;
}

$data['custom_field_section_id'] = null; // I need add section_id here

return $data;
})
->action(fn(array $data) => CustomField::create($data))
->slideOver();
}
12 replies
FFilament
Created by Gush on 11/21/2023 in #❓┊help
table layout without removing the column names row?
🥳
5 replies