diff --git a/class/MesBR.php b/class/MesBR.php index 92e8c34..a6c39a1 100644 --- a/class/MesBR.php +++ b/class/MesBR.php @@ -61,6 +61,10 @@ class MesBR $res = $this->callAPI("GET", "/updatebasket", $datas); + if (!$res) { + error_log("MESBR - CODE : 999 - MESSAGE : Cannot read API Response (non json)"); + return ['status' => 'KO', 'code' => 999, 'message' => 'Cannot read API Response (non json)']; + } if ($res->Statut === 'KO') { error_log("MESBR - CODE : $res->Code - MESSAGE : $res->Message"); return ['status' => 'KO', 'code' => $res->Code, 'message' => $res->Message]; diff --git a/database/migrations/2021_09_29_173331_make_instant_win_unique_in_participation.php b/database/migrations/2021_09_29_173331_make_instant_win_unique_in_participation.php new file mode 100644 index 0000000..3831f7f --- /dev/null +++ b/database/migrations/2021_09_29_173331_make_instant_win_unique_in_participation.php @@ -0,0 +1,32 @@ +unique('instant_win_id'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('participation', function (Blueprint $table) { + // + }); + } +}