JonathanH-UK
Unable to store the original CSV file and access the filename from an Importer
I'm attempting to use the Filament v3 Importer to replace some legacy PHP code but I'm struggling with it 😦
I really need to log the original uploaded filename and keep a copy of the uploaded file.
Ideally I would like to use the filename as the Job Batch
name
(which is currently null
). However the FileUpload
action appears to be hard-coded inside a huge function in the CanImportRecords
Trait and I cannot see any way to expose the underlying data from within my ImportAction or Importer classes.
Is there any simple way to achieve this please?1 replies
How to prevent releationship creation on Fieldset when field _inside_ the Fieldset is empty
I've found an example from "How do I make a relationship optional?" posted by @TheCrazyBob which uses
->saveRelationshipsUsing($record,$state)
however in this case it's making the condition on some other field on the main form whereas I want to only create this relationship if a field inside the FieldSet has been filled.
At the moment $record
only contains the parent record's fields. Is there a way I can do this based on the Form input instead please?2 replies
How can I customise the select list on a Relationship Manager's modal form?
I've tried so many ways to do what seems a really simple task:
Given a belongsToMany relationship between Training and Trainee models, I am using a TraineeRelationManager to attach Trainees to the Training.
This works fine by default but we could have numerous trainees called "John Smith" and the default relationship manager gives me now way to tell which is which.
Therefore I am trying to include the name of each Trainee's Organisation which is a belongsTo relationship on the Trainee.
i.e. Instead of a searchable select of potentially thousands of trainees just returning the "$trainee->name" , I need a string such as "$trainee->name ( $trainee->organisation )".
How can this be done on a Relation Manager please?
29 replies