refactor the blades
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace App\Exports\V3\RoadPatrols;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithDrawings;
|
||||
@@ -14,7 +15,7 @@ use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
|
||||
class OperatorCartableReport implements FromView, WithEvents, ShouldAutoSize, WithDrawings
|
||||
|
||||
{
|
||||
public function __construct(private array $data){}
|
||||
public function __construct(private Collection $data){}
|
||||
|
||||
public function view(): View
|
||||
{
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
namespace App\Exports\V3\RoadPatrols;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Database\Eloquent\Collection;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
||||
use Maatwebsite\Excel\Concerns\WithDrawings;
|
||||
@@ -14,7 +15,7 @@ use PhpOffice\PhpSpreadsheet\Worksheet\Drawing;
|
||||
class SupervisorCartableReport implements FromView, WithEvents, ShouldAutoSize, WithDrawings
|
||||
|
||||
{
|
||||
public function __construct(private array $data){}
|
||||
public function __construct(private Collection $data){}
|
||||
|
||||
public function view(): View
|
||||
{
|
||||
|
||||
@@ -84,7 +84,7 @@ class RoadPatrolProjectController extends Controller
|
||||
{
|
||||
$name = 'گزارش از کارتابل ارزیابی گشت راهداری ' . verta()->now()->format('Y-m-d H:i') . '.xlsx';
|
||||
$data = $roadPatrolReportService->supervisorCartableReport($request);
|
||||
return Excel::download(new SupervisorCartableReport($data), $name);
|
||||
return Excel::download(new SupervisorCartableReport($data['data']), $name);
|
||||
}
|
||||
|
||||
public function operatorIndex(Request $request, RoadPatrolReportService $roadPatrolReportService): JsonResponse
|
||||
@@ -321,6 +321,6 @@ class RoadPatrolProjectController extends Controller
|
||||
{
|
||||
$name = 'گزارش از کارتابل عملیات گشت راهداری ' . verta()->now()->format('Y-m-d H:i') . '.xlsx';
|
||||
$data = $roadPatrolReportService->operatorCartableReport($request);
|
||||
return Excel::download(new OperatorCartableReport($data), $name);
|
||||
return Excel::download(new OperatorCartableReport($data['data']), $name);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user