Support the ongoing development of Laravel.io →
Laravel Blade Artisan

I want to export the data from the Datatables to excel or CSV files.

I have been searching for more than 3 hours but I can't find the solution that fits my code.

Below is my blade file code

blade

Now I am pasting my controller file function

controller-function

I just want two buttons so that when I click on one of the button it will do work as suggested. I think there might be some syntax or boilerplate in yajra tables.

Please help me to solve such problem!

Thank you in advance

Last updated by @aatmik-coder 2 years ago.

vanny2000 liked this thread

1

Firstly, I'll advice you use the normal html/jquery datatable cdn, to populate your data. In that way, u easily handle the export button. Starting with php artisan make:export... I implemented sometime ago, I will take you through the implementation, if you apply the architecture above

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.