diff --git a/app/Http/Controllers/GadaiController.php b/app/Http/Controllers/GadaiController.php index 2fba4ab..597b415 100644 --- a/app/Http/Controllers/GadaiController.php +++ b/app/Http/Controllers/GadaiController.php @@ -1131,7 +1131,8 @@ class GadaiController extends Controller $updatehistory = Gadai::on($cawangan['mysql']) ->where('norujukan','=',$norujukan) ->update(array( - 'historygadaian' => $request->historygadaian + 'historygadaian' => $request->historygadaian, + 'tag_tebus' => $request->jenistebus, )); return response()->json($updatehistory,200); diff --git a/database/migrations/2024_02_20_092545_add_tag_tebus_to_gadai.php b/database/migrations/2024_02_20_092545_add_tag_tebus_to_gadai.php new file mode 100644 index 0000000..af67d3e --- /dev/null +++ b/database/migrations/2024_02_20_092545_add_tag_tebus_to_gadai.php @@ -0,0 +1,61 @@ +getPdo(); + return true; + } catch(\Exception $e){ + Log::info($connection); + return false; + } + }); + return $db_connection; + } + + public function up() + { + $db_connection = $this->getActiveDB(); + + foreach($db_connection as $dbase){ + Schema::connection($dbase)->table('gadai', function (Blueprint $table) use($dbase) { + + $isTagTebus = Schema::connection($dbase)->hasColumn('gadai', 'tag_tebus'); + + if(! $isTagTebus){ + $table->char('tag_tebus', 2); + } + + }); + } + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('gadai', function (Blueprint $table) { + // + }); + } +}