v2 first commit
This commit is contained in:
		
							
								
								
									
										31
									
								
								app/Exports/Common/Reports.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								app/Exports/Common/Reports.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | ||||
| <?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'; | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user