change header excel export php laravel
<p><a href="http://imgur.com/fypWZgy" rel="nofollow">http://imgur.com/fypWZgy</a></p>

<p>Here's what I have when trying to export it. It uses the attribute key by default. I want to change it into my own headers. For example payStatus to payment.</p>

<p>Here's my code:</p>

<pre><code>public function exportReferral($sourceRef){
    ob_end_clean();
    ob_start(); //At the very top of your program (first line)
    \Excel::create('ViecBonus ' . 'referal report', function($excel) use ($sourceRef) {
            $excel-&gt;sheet('ViecBonus Data', function($sheet) use ($sourceRef) {
                $sheet-&gt;fromModel($sourceRef);
            });
    })-&gt;export('xlsx');
}
</code></pre>