Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Moeez448's avatar

Want to export database entries in to the Public folder of Laravel

I just want to export My database table and store that excel file in to the public folder.Here is my code but it's not working properly.

Excel::download(new CleanSheetsExport, public_path('clean_sheet/' . preg_replace('/[^A-Za-z0-9-]/', '', $retailer->user->name) . ' ' . $retailerReportSubmission->location . ' ' . Carbon::parse($retailerReportSubmission->date)->format('M') . '.xlsx'));

0 likes
1 reply

Please or to participate in this conversation.