Files
shipping-portal/app/Classes/Modules/Reports/ControllersLogic/CustomcClearanceLogic.php
T
2021-09-27 11:06:38 +08:00

40 lines
1.2 KiB
PHP

<?php
namespace App\Classes\Modules\Reports\ControllersLogic;
use App\Classes\General\Abstracts\AbstractControllerLogic;
use App\Models\User;
use Maatwebsite\Excel\Concerns\FromCollection;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use App\Classes\Modules\Reports\ControllersLogic\ExportExcelLogic;
use App\Classes\Modules\PackingLists\Processors\FetchPackingListProcessor;
class CustomcClearanceLogic extends AbstractControllerLogic
{
private $excelExportLogic;
private $listsPackingListProcessor;
public function __construct(FetchPackingListProcessor $listsPackingListProcessor){
$this->listsPackingListProcessor = $listsPackingListProcessor;
}
protected function notification():array {
return [];
}
public function logic(Request $request) : JsonResponse
{
$params = $request->all();
$packingLists = $this->listsPackingListProcessor->execute($params);
$excelExportLogic = new ExportExcelLogic(collect($packingLists));
$this->excelExportLogic = $excelExportLogic;
return response()->json(['success' => true]);
}
public function getExcelCollection(){
return $this->excelExportLogic;
}
}