<?php
|
namespace App\Vola\Services\FakeSSODatabase;
|
|
use App\Models\Msisdn;
|
use App\Models\VodafoneUser;
|
use Exception;
|
use Illuminate\Support\Facades\DB;
|
use PDOException;
|
|
class FakeSSODatabaseHandler {
|
|
public function insertDataIntoTables(array $data) {
|
try{
|
|
|
$userModel = VodafoneUser::create(['Name' => $data["Name"],
|
'Surname' => $data["Surname"],
|
'EmailAddress' => $data["EmailAddress"]]);
|
Msisdn::create(['MSISDN' => $data["sim_1"],
|
'IdPiano' => $data['IdPiano'],
|
'LinkedUser' => $userModel->id]);
|
}catch(PDOException $e) {
|
echo $e->getMessage();
|
}
|
|
}
|
|
|
}
|