edms2023/app/Exports/ListingExport.php

40 lines
1.1 KiB
PHP

<?php
namespace App\Exports;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithStrictNullComparison;
use Illuminate\Contracts\View\View;
class ListingExport implements FromView, ShouldAutoSize, WithStrictNullComparison
{
public function __construct($row)
{
$this->workflowtypes= $row[0];
$this->input = $row[1];
$this->documents = $row[2];
$this->dashboard = isset($row[3]) ? 'dashboard' : 'listing';
$this->export = true;
}
public function view(): View
{
if($this->dashboard == 'listing')
return view('listings.index-table', [
'workflowtypes'=>$this->workflowtypes,
'input'=>$this->input,
'documents'=>$this->documents,
'exp' => true,
]);
else if($this->dashboard == 'dashboard')
return view('dashboard.list-table', [
'workflowtypes'=>$this->workflowtypes,
'input'=>$this->input,
'documents'=>$this->documents,
'exp' => true,
]);
}
}