F
Filament4w ago
gg

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
Hussain4real
Hussain4real4w ago
can you explain clearly what you want to achieve
gg
ggOP4w ago
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?
Hussain4real
Hussain4real4w ago
it doesn't have to be in headerAction you can put it in normal table actions:
use App\Filament\Exports\ProductExporter;
use Filament\Actions\ExportAction;

ExportAction::make()
->exporter(ProductExporter::class)
use App\Filament\Exports\ProductExporter;
use Filament\Actions\ExportAction;

ExportAction::make()
->exporter(ProductExporter::class)
` you will have to modify your export columns to include the students of each university record
gg
ggOP4w ago
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)
Hussain4real
Hussain4real4w ago
by default when u add the export action to actions in a table it references the current record(university)

Did you find this page helpful?