diff --git a/app/Http/Controllers/CekStatusController.php b/app/Http/Controllers/CekStatusController.php new file mode 100644 index 0000000..f33837d --- /dev/null +++ b/app/Http/Controllers/CekStatusController.php @@ -0,0 +1,81 @@ +first(); + if($data != null) { + return response()->json([ + 'status' => true, + 'msg' => 'Data ditemukan (' . $id . ')', + 'status_data' => $data->status_tes, + 'nama_lengkap' => $data->nama_lengkap, + 'kode_unik' => $data->kode_unik, + 'tgl_booking' => $data->tgl_booking, + 'deskripsi_tambahan' => $data->deskripsi_tambahan, + ]); + } else { + return response()->json([ + 'status' => false, + 'msg' => 'Data tidak ditemukan (' . $id . ')' + ]); + } + } + + /** + * Show the form for editing the specified resource. + */ + public function edit(string $id) + { + // + } + + /** + * Update the specified resource in storage. + */ + public function update(Request $request, string $id) + { + // + } + + /** + * Remove the specified resource from storage. + */ + public function destroy(string $id) + { + // + } +} diff --git a/app/Models/BookingModel.php b/app/Models/BookingModel.php index 283ae5b..beb7df8 100644 --- a/app/Models/BookingModel.php +++ b/app/Models/BookingModel.php @@ -21,7 +21,8 @@ class BookingModel extends Model 'no_telp', 'kode_unik', 'tgl_booking', - 'deskripsi_tambahan' + 'deskripsi_tambahan', + 'status_tes' ]; protected $casts = [ @@ -35,6 +36,10 @@ protected static function boot() if (empty($model->id_booking)) { $model->id_booking = Str::uuid(); } + + if(empty($model->status_tes)) { + $model->status_tes = 0; + } }); } } diff --git a/bootstrap/app.php b/bootstrap/app.php index ea0532a..7483989 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -15,6 +15,9 @@ $middleware->alias([ 'role.auth' => RoleAuth::class, ]); + $middleware->validateCsrfTokens(except: [ + 'api/eye/test' + ]); }) ->withExceptions(function (Exceptions $exceptions): void { // diff --git a/database/migrations/2026_03_27_221207_add_column_in_booking_table.php b/database/migrations/2026_03_27_221207_add_column_in_booking_table.php new file mode 100644 index 0000000..2e3b254 --- /dev/null +++ b/database/migrations/2026_03_27_221207_add_column_in_booking_table.php @@ -0,0 +1,28 @@ +enum('status_tes', [0, 1, 2]); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void + { + Schema::table('booking', function (Blueprint $table) { + $table->dropColumn('status_tes'); + }); + } +}; diff --git a/resources/views/user/layouts/navbar.blade.php b/resources/views/user/layouts/navbar.blade.php index 8703f81..cd5aff8 100644 --- a/resources/views/user/layouts/navbar.blade.php +++ b/resources/views/user/layouts/navbar.blade.php @@ -15,7 +15,7 @@ -
+
  • Home
  • About
  • System Architecture
  • -
  • Services
  • +
  • Cek Status
  • Contact
  • @if (session('is_logged_in'))