laravel excel export a select instead of table , how to return?
i have a raw query i want to export using maatwebsite excel. but usually when i do it is with tables, and this time it's a select, i'm not sure how to do it because usually the queryes do like : "DB::table("tableReport")"
and this time its with a DB::select("sql")...
@tykus when i press export it says on the title base table or view not found althouth i'm clickinig export from it's view... its not a table and on model i got it as protected $table
@peterpan26 you're going to need to share the full error message. The error base table or view not found suggests you are either (i) using the wrong table name (ii) the wrong connection (iii) need to run migrations (iv) ...
@tykus the only difference from the other exports is as i said above, the other queries are made with DB::table('tablename') its made with DB::select('rawsql') , and its not an index, its instead of index, a show() ,
the only error i get more is a code 500, and on title of the page says base table or view not found. i can't even read it entirely but yes its that error
i had to create the table. the doubt now is how to insert and update without letting it duplicate keys, the query has subqueries and unions inside it, i'm now being able to find how to update it