davy_yg
284
6
Laravel

Export

Posted 8 months ago by davy_yg

Hello,

I wonder how the export command works in laravel?

I am following this tutorial: https://laravel-excel.maatwebsite.nl/3.0/exports/

and still do not understand how to export this data:

public function listReport(Request $request) {

        $report = ReportModel::leftJoin('tb_m_biller_solusi', function($join){
                $join->on('tb_r_solusiorder.productid', '=', 'tb_m_biller_solusi.Productid');
                $join->on('tb_r_solusiorder.billerid', '=', 'tb_m_biller_solusi.Billerid');            
        })
            ->leftJoin('tb_m_biller', 'tb_r_solusiorder.billerid', '=', 'tb_m_biller.biller_id')        
            ->get();

    
            return view('pages.report.list')
                ->with('list', $report);
    
    }

This is the button:

report.list.blade.php

<div class="card mb-3">
        <div class="card-header">
        <div style="float:left">
            <i class="fa fa-table"></i> Reports
        </div>
        <div style="float:right">
                <a class="btn btn-primary" href="{{ url('/create-report') }}" id="toggleNavColor">
                Export Report
            </a>
        </div>
    </div>

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.