2020-01-07 01:13:47 +01:00
|
|
|
<?php
|
|
|
|
/**
|
2020-09-06 11:38:10 +02:00
|
|
|
* Invoice Ninja (https://invoiceninja.com).
|
2020-01-07 01:13:47 +01:00
|
|
|
*
|
|
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
|
|
*
|
2024-04-12 06:15:41 +02:00
|
|
|
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
2020-01-07 01:13:47 +01:00
|
|
|
*
|
2021-06-16 08:58:16 +02:00
|
|
|
* @license https://www.elastic.co/licensing/elastic-license
|
2020-01-07 01:13:47 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
namespace App\Factory;
|
|
|
|
|
|
|
|
use App\Models\CreditInvitation;
|
|
|
|
use Illuminate\Support\Str;
|
|
|
|
|
|
|
|
class CreditInvitationFactory
|
|
|
|
{
|
2024-01-14 05:05:00 +01:00
|
|
|
public static function create(int $company_id, int $user_id): CreditInvitation
|
2020-01-07 01:13:47 +01:00
|
|
|
{
|
2024-01-14 05:05:00 +01:00
|
|
|
$ci = new CreditInvitation();
|
2020-01-07 01:13:47 +01:00
|
|
|
$ci->company_id = $company_id;
|
|
|
|
$ci->user_id = $user_id;
|
|
|
|
$ci->client_contact_id = null;
|
|
|
|
$ci->credit_id = null;
|
|
|
|
$ci->key = Str::random(config('ninja.key_length'));
|
|
|
|
$ci->transaction_reference = null;
|
|
|
|
$ci->message_id = null;
|
|
|
|
$ci->email_error = '';
|
|
|
|
$ci->signature_base64 = '';
|
|
|
|
$ci->signature_date = null;
|
|
|
|
$ci->sent_date = null;
|
|
|
|
$ci->viewed_date = null;
|
|
|
|
$ci->opened_date = null;
|
|
|
|
|
|
|
|
return $ci;
|
|
|
|
}
|
|
|
|
}
|