2019-11-16 10:21:14 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Exports\Common;
|
|
|
|
|
|
|
|
use Illuminate\Contracts\View\View;
|
2021-06-11 17:53:42 +03:00
|
|
|
use Maatwebsite\Excel\Concerns\Exportable;
|
2019-11-16 10:21:14 +03:00
|
|
|
use Maatwebsite\Excel\Concerns\FromView;
|
|
|
|
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
|
|
|
|
use Maatwebsite\Excel\Concerns\WithTitle;
|
|
|
|
|
|
|
|
class Reports implements FromView, ShouldAutoSize, WithTitle
|
|
|
|
{
|
2021-06-11 17:53:42 +03:00
|
|
|
use Exportable;
|
|
|
|
|
2019-11-16 10:21:14 +03:00
|
|
|
protected $view;
|
|
|
|
|
|
|
|
protected $class;
|
|
|
|
|
|
|
|
public function __construct($view, $class)
|
|
|
|
{
|
|
|
|
$this->view = $view;
|
|
|
|
$this->class = $class;
|
|
|
|
}
|
|
|
|
|
|
|
|
public function view(): View
|
|
|
|
{
|
|
|
|
return view($this->view, ['class' => $this->class]);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function title(): string
|
|
|
|
{
|
|
|
|
return 'reports';
|
|
|
|
}
|
2020-01-20 00:21:37 +03:00
|
|
|
}
|