inital commit
This commit is contained in:
23
app/Services/ViewExport.php
Normal file
23
app/Services/ViewExport.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Maatwebsite\Excel\Concerns\FromView;
|
||||
|
||||
class ViewExport implements FromView
|
||||
{
|
||||
public function __construct($data,$view)
|
||||
{
|
||||
$this->data = $data;
|
||||
$this->view = $view;
|
||||
|
||||
}
|
||||
|
||||
public function view(): View
|
||||
{
|
||||
//dd($this->data);
|
||||
return view($this->view, $this->data);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user