<?php
namespace Database\Seeders;
use App\Classes\GeneralGenerator;
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\Hash;
use DB;
use Ramsey\Uuid\Uuid;
use SimpleSoftwareIO\QrCode\Facades\QrCode;
class CustomerAccountsTableSeeder extends Seeder
{
protected $geral;
public function run()
{
$g = new GeneralGenerator();
$this->geral = $g;
$g = new GeneralGenerator();
$uuid = Uuid::uuid4();
QrCode::size(250)->format('svg')->mergeString(public_path('/images/geral/logo.png'))->generate($uuid, public_path('images/account/' . $uuid . '.svg'));
DB::table('customer_accounts')->insert([
'0' => [
'name' => 'Paytek Africa',
'nuit' => '1245245489',
'email' => 'info@paytek-africa.com',
'mobile_phone1' => '845030902',
'mobile_phone2' => '821414552',
'account_number' => $this->geral->generateAccountNumberAndCardNumber(),
'reference' => $this->geral->generateReference(),
'balance' => '1000',
'balance_cards' => '100',
'qrcode' => 'link',
'document_type' => 'Bi',
'public_id' =>url('/') . '/images/account/' . $uuid . '.svg' ,
'document_number' => '121545423541565Q',
'address' => 'Maputo, Rua cardoso 41',
'password' => Hash::make('12345678'),
'pin' => Hash::make('1234'),
'status' => 'activo',
'created_at' => now(),
'updated_at' => now()
]
]);
}
}