37 lines
		
	
	
		
			706 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			706 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Exports\Purchases;
 | |
| 
 | |
| use App\Abstracts\Export;
 | |
| use App\Models\Common\Contact as Model;
 | |
| 
 | |
| class Vendors extends Export
 | |
| {
 | |
|     public function collection()
 | |
|     {
 | |
|         $model = Model::type('vendor')->usingSearchString(request('search'));
 | |
| 
 | |
|         if (!empty($this->ids)) {
 | |
|             $model->whereIn('id', (array) $this->ids);
 | |
|         }
 | |
| 
 | |
|         return $model->get();
 | |
|     }
 | |
| 
 | |
|     public function fields(): array
 | |
|     {
 | |
|         return [
 | |
|             'name',
 | |
|             'email',
 | |
|             'tax_number',
 | |
|             'phone',
 | |
|             'address',
 | |
|             'website',
 | |
|             'currency_code',
 | |
|             'reference',
 | |
|             'enabled',
 | |
|             'user_id',
 | |
|         ];
 | |
|     }
 | |
| }
 |