How to export related students from single university? I see only export by header action.
Hello I have a table universities and students
In the university list table actions(view,edit,export students) , I want to export students of each university by export button.
5 Replies
can you explain clearly what you want to achieve
I had university model and students . university and students is many to many relationships.
I had university resource and each university record had 3 actions (view, edit, download students).
So, when I click download students, I want to download of students which related with university using laravel export action but now I see that export action is only for bulk actions. How can I get in there for single download?
it doesn't have to be in headerAction
you can put it in normal table actions:
`
you will have to modify your export columns to include the students of each university record
how can I pass university id in these? I want to pass and filter by id to get related university stuents.
ExportAction::make()
->exporter(ProductExporter::class)
by default when u add the export action to actions in a table it references the current record(university)