vanhellsing101
vanhellsing101
FFilament
Created by vanhellsing101 on 4/4/2024 in #❓┊help
Import Action: How to remove the example download link or add multiple rows to the example CSV?
I let it open to see if there was any solution other than that but looking at the code itself it seems only 1 row support is coded into the import action itself.
8 replies
FFilament
Created by vanhellsing101 on 4/4/2024 in #❓┊help
Import Action: How to remove the example download link or add multiple rows to the example CSV?
Yeah, that's what I mentioned above. But still, it would be better if they allowed to add multiple rows for the example csv.
8 replies
FFilament
Created by Benjámin on 9/26/2023 in #❓┊help
SelectAction state change action
The solution helped me a lot thanks! I was looking in the wrong direction trying to use SelectAction.
8 replies
FFilament
Created by vanhellsing101 on 4/9/2024 in #❓┊help
Filament Resource only edit page?
https://filamentphp.com/docs/3.x/panels/pages#creating-a-page It is a Filament Page. Litrellay the example it shows matches my case! 🎉 Every time I create a help post here I get the answer in a docs or through some hacky way by myself. :squint: 😝
3 replies
FFilament
Created by vanhellsing101 on 4/4/2024 in #❓┊help
Import Action: Import data for the belongsTo relationship without having foreign_id in CSV itself?
Sure, ImportAction
ImportAction::make()
->importer(StaffImporter::class)
->options([
'client_id' => //data you need pass,
]),
ImportAction::make()
->importer(StaffImporter::class)
->options([
'client_id' => //data you need pass,
]),
In the Importer you can now access the client_id using $this->options['client_id'] example in resolveRecord method
public function resolveRecord(): ?Staff
{
$client_id = $this->options['client_id'];

return Staff::firstOrNew([
'client_id' => $client_id,
'email' => $this->data['email'],
]);
}
public function resolveRecord(): ?Staff
{
$client_id = $this->options['client_id'];

return Staff::firstOrNew([
'client_id' => $client_id,
'email' => $this->data['email'],
]);
}
6 replies
FFilament
Created by vanhellsing101 on 4/4/2024 in #❓┊help
Import Action: How to remove the example download link or add multiple rows to the example CSV?
Well, looks like to disable it we can provide an empty modal description to the Import Action but still feels like a hacky way to do it. It would be better if we could control the example csv
8 replies
FFilament
Created by vanhellsing101 on 4/4/2024 in #❓┊help
Import Action: Import data for the belongsTo relationship without having foreign_id in CSV itself?
I have solved it using the options method that ImportAction provides (it was staring right at me in the docs 😅) https://filamentphp.com/docs/3.x/actions/prebuilt-actions/import#using-import-options First I used the mutateFormDataUsing ofActions and passed id there and fetched that using the getOptions of the importer, which worked but I was still not satisfied and remembered that there are the options in the docs too and I was doing something extra. I just opened the doc tab I had already opened and there it was. Well it is always good to try many possibilities 😝
6 replies