21 lines
501 B
PHP
21 lines
501 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace Modules\Business\App\Exports;
|
||
|
|
|
||
|
|
use App\Models\Transaction;
|
||
|
|
use Illuminate\Contracts\View\View;
|
||
|
|
use Maatwebsite\Excel\Concerns\FromView;
|
||
|
|
|
||
|
|
class ExportTransactionReport implements FromView
|
||
|
|
{
|
||
|
|
public function view(): View
|
||
|
|
{
|
||
|
|
$transactions = Transaction::with('paymentType')
|
||
|
|
->where('business_id', auth()->user()->business_id)
|
||
|
|
->latest()
|
||
|
|
->get();
|
||
|
|
|
||
|
|
return view('business::transactions.excel-csv', compact('transactions'));
|
||
|
|
}
|
||
|
|
}
|