Filippo Bertilotti
2024-09-10 13f6a9f0f63796e7b9767ccd83f1c3a17d496b0c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?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();
        }
 
    }
 
 
}