mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-10-30 21:12:57 -04:00 
			
		
		
		
	
		
			
				
	
	
		
			35 lines
		
	
	
		
			904 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			904 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| /**
 | |
|  * Invoice Ninja (https://invoiceninja.com)
 | |
|  *
 | |
|  * @link https://github.com/invoiceninja/invoiceninja source repository
 | |
|  *
 | |
|  * @copyright Copyright (c) 2019. Invoice Ninja LLC (https://invoiceninja.com)
 | |
|  *
 | |
|  * @license https://opensource.org/licenses/AAL
 | |
|  */
 | |
| 
 | |
| namespace App\Transformers;
 | |
| 
 | |
| use App\Models\Invoice;
 | |
| use App\Models\InvoiceInvitation;
 | |
| use App\Utils\Traits\MakesHash;
 | |
| 
 | |
| class InvoiceInvitationTransformer extends EntityTransformer
 | |
| {
 | |
|     use MakesHash;
 | |
| 
 | |
|     public function transform(InvoiceInvitation $invitation)
 | |
|     {
 | |
| 
 | |
|         return [
 | |
|             'id' => $this->encodePrimaryKey($invitation->id),
 | |
|             'key' => $invitation->getName(),
 | |
|             'link' => $invitation->getLink(),
 | |
|             'sent_date' => $invitation->sent_date ?: '',
 | |
|             'viewed_date' => $invitation->sent_date ?: '',
 | |
|             'opened_date' => $invitation->opened_date ?: '',
 | |
|         ];
 | |
|     }
 | |
| }
 |