mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/shipping-portal.git
synced 2026-08-19 12:34:18 +00:00
559de29acf
export multiple sheet with the correct name of each field
33 lines
984 B
PHP
33 lines
984 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Delivery;
|
|
|
|
|
|
use App\Classes\Modules\Exports\Services\ExportsCustomers;
|
|
use App\Classes\Modules\Exports\Services\ExportsMultipleDeliveryOrders;
|
|
use App\Models\User;
|
|
use Illuminate\Http\Request;
|
|
use Illuminate\Support\Facades\Auth;
|
|
use Maatwebsite\Excel\Excel;
|
|
|
|
class ExportDeliveryOrdersToExcelController
|
|
{
|
|
|
|
/**
|
|
* ExportCustomersToExcelController constructor.
|
|
* @param Request $request
|
|
*/
|
|
public function __construct(Request $request)
|
|
{
|
|
$token = Auth::fromUser(User::find(1));
|
|
$request->headers->set('Authorization', 'Bearer '.$token);
|
|
}
|
|
|
|
public function lineClear(Request $request){
|
|
$exportsTransactions = new ExportsMultipleDeliveryOrders($request);
|
|
$response = $exportsTransactions->download('line-clear-export.xls', Excel::XLS, ['Content-Type' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet']);
|
|
ob_end_clean();
|
|
return $response;
|
|
}
|
|
|
|
} |