akaunting/app/Exports/Common/Reports.php

32 lines
616 B
PHP
Raw Normal View History

2019-11-16 10:21:14 +03:00
<?php
namespace App\Exports\Common;
use Illuminate\Contracts\View\View;
use Maatwebsite\Excel\Concerns\FromView;
use Maatwebsite\Excel\Concerns\ShouldAutoSize;
use Maatwebsite\Excel\Concerns\WithTitle;
class Reports implements FromView, ShouldAutoSize, WithTitle
{
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
}