Merge pull request #8311 from turbo124/v5-develop

Update randomdataseeder
This commit is contained in:
David Bomba 2023-02-26 09:39:17 +11:00 committed by GitHub
commit c9b7dd79d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 1 deletions

View File

@ -148,7 +148,7 @@ class HtmlEngine
$data['$payment_button'] = ['value' => $this->buildViewButton($this->invitation->getPaymentLink(), ctrans('texts.pay_now')), 'label' => ctrans('texts.pay_now')];
$data['$payment_link'] = ['value' => $this->invitation->getPaymentLink(), 'label' => ctrans('texts.pay_now')];
$data['$payment_qrcode'] = ['value' => $this->invitation->getPaymentQrCode(), 'label' => ctrans('texts.pay_now')];
$data['$exchange_rate'] = ['value' => $this->entity->exchange_rate ?: ' ', 'label' => ctrans('texts.exchange_rate')];
if ($this->entity_string == 'invoice' || $this->entity_string == 'recurring_invoice') {
$data['$entity'] = ['value' => '', 'label' => ctrans('texts.invoice')];

View File

@ -117,6 +117,60 @@ class RandomDataSeeder extends Seeder
'settings' => null,
]);
$user = User::firstOrNew([
'email' => 'user@example.com',
]);
$user->password = Hash::make('password');
$user->email_verified_at = now();
$user->save();
$user->companies()->attach($company->id, [
'account_id' => $account->id,
'is_owner' => 1,
'is_admin' => 1,
'is_locked' => 0,
'notifications' => CompanySettings::notificationDefaults(),
'permissions' => '',
'settings' => null,
]);
$company_token = CompanyToken::create([
'user_id' => $user->id,
'company_id' => $company->id,
'account_id' => $account->id,
'name' => 'test token',
'token' => \Illuminate\Support\Str::random(64),
]);
$user = User::firstOrNew([
'email' => 'permissions@example.com',
]);
$user->password = Hash::make('password');
$user->email_verified_at = now();
$user->save();
$company_token = CompanyToken::create([
'user_id' => $user->id,
'company_id' => $company->id,
'account_id' => $account->id,
'name' => 'test token',
'token' => \Illuminate\Support\Str::random(64),
]);
$user->companies()->attach($company->id, [
'account_id' => $account->id,
'is_owner' => 0,
'is_admin' => 0,
'is_locked' => 0,
'notifications' => CompanySettings::notificationDefaults(),
'permissions' => '',
'settings' => null,
]);
$client = Client::factory()->create([
'user_id' => $user->id,
'company_id' => $company->id,