mirror of
https://gitlab.com/uldvstar/exchange-2.0.git
synced 2026-08-19 04:24:16 +00:00
30 lines
928 B
PHP
30 lines
928 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Exports;
|
|
|
|
|
|
use App\Classes\Modules\Exports\Services\ExportsAnalyticBookingTransactions;
|
|
use App\Models\User;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Maatwebsite\Excel\Excel;
|
|
|
|
class ExportAnalyticToExcelController
|
|
{
|
|
|
|
/**
|
|
* ExportAnalyticToExcelController constructor.
|
|
* @param Request $request
|
|
*/
|
|
public function __construct(Request $request)
|
|
{
|
|
$token = Auth::fromUser(User::find(1));
|
|
$request->headers->set('Authorization', 'Bearer '.$token);
|
|
}
|
|
|
|
public function bookingData(ExportsAnalyticBookingTransactions $exportsAnalyticBookingTransactions, Request $request){
|
|
$response = $exportsAnalyticBookingTransactions->download('bookingData.csv', Excel::CSV, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
|
ob_end_clean();
|
|
return $response;
|
|
}
|
|
} |