This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
I have club table and user table. club hasMany user and I was using partial to show the user table in club Forms. I created toolbarPartial: user_toolbar and added export button in toolbar. I can export the user data but only all user data. How can I filter the user by club? Thank you.
Last updated
Hi Raymond,
To control the export data, you can define an export model to apply constraints to the query used for collecting data. Here is a link to the relevant documentation article:
https://docs.octobercms.com/2.x/backend/import-export.html#defining-an-export-model
I hope this helps!
Thanks for your help.
I created the UserExportModel and public function exportData, it can constraints to the query in where club_id = 1 in hardcoded but cannot get club_id to UserExportModel.
How can I get club_id in club to UserExportModel or through toolbar export button get club_id?
1-4 of 4