mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-31 15:37:30 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			17 lines
		
	
	
		
			500 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			17 lines
		
	
	
		
			500 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php namespace App\Ninja\Serializers;
 | |
| 
 | |
| use League\Fractal\Serializer\ArraySerializer as FractalArraySerializer;
 | |
| 
 | |
| class ArraySerializer extends FractalArraySerializer
 | |
| {
 | |
|     public function collection($resourceKey, array $data)
 | |
|     {
 | |
|         return ($resourceKey && $resourceKey !== 'data') ? array($resourceKey => $data) : $data;
 | |
|     }
 | |
| 
 | |
|     public function item($resourceKey, array $data)
 | |
|     {
 | |
|         return ($resourceKey && $resourceKey !== 'data') ? array($resourceKey => $data) : $data;
 | |
|     }
 | |
| }
 |