how to export using laravel excel with calling mysql stored procedure?

  laravel, laravel-excel, mysql, php, stored-procedures

I’m trying to export my pivoted attendance data using Maatwebsite/LaravelExcel, and I use mysql stored procedure to retrieve the pivoted data, but I’m having some problems, how can I export my data using my query stored procedure? I haven’t found a solution to this problem, or should I change my query to eloquent form so that it matches the method documentation at, or is there another solution for this problem ?, here is my work


   date            lat                long         user_id      image            created_at 
2020-09-16     -6.8517888         107.4987008         1      1590688525.jpg     2020-09-16 11:55:25
2020-09-16     -6.8517888         107.4987008         2      1590725637.jpg     2020-09-16 11:55:25
2020-09-16     -6.8517888         107.4987008         3      1590725723.jpg     2020-09-16 11:55:25
2020-09-16     -6.8517888         107.4987008         4      1590726094.jpg     2020-09-16 11:55:25
2020-09-16     -6.8517888         107.4987008         5      1590726264.jpg     2020-09-16 11:55:25
xxxx           xxxx               xxxx                x      xxxx               xxxx
xxxx           xxxx               xxxx                x      xxxx               xxxx
xxxx           xxxx               xxxx                x      xxxx               xxxx

AttendanceQueryExport.php ->

Mysql Stored Procedure Queries ->

Example Result From Queries ->

When I try to export with the code above, I get an error like this ->

Source: Laravel

Leave a Reply