added import export for categories
This commit is contained in:
		
							
								
								
									
										30
									
								
								app/Exports/Settings/Categories.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										30
									
								
								app/Exports/Settings/Categories.php
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,30 @@ | ||||
| <?php | ||||
|  | ||||
| namespace App\Exports\Settings; | ||||
|  | ||||
| use App\Abstracts\Export; | ||||
| use App\Models\Setting\Category as Model; | ||||
|  | ||||
| class Categories extends Export | ||||
| { | ||||
|     public function collection() | ||||
|     { | ||||
|         $model = Model::usingSearchString(request('search')); | ||||
|  | ||||
|         if (!empty($this->ids)) { | ||||
|             $model->whereIn('id', (array) $this->ids); | ||||
|         } | ||||
|  | ||||
|         return $model->cursor(); | ||||
|     } | ||||
|  | ||||
|     public function fields(): array | ||||
|     { | ||||
|         return [ | ||||
|             'name', | ||||
|             'type', | ||||
|             'color', | ||||
|             'enabled', | ||||
|         ]; | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user