first(); if($data != null) { if($data->status_tes == '1' && $data->unix_expired_time < time()) { $data->update([ 'status_tes' => '0' ]); } return response()->json([ 'status' => true, 'msg' => 'Data ditemukan (' . $id . ')', 'id_booking' => $data->id_booking, 'status_data' => $data->status_tes, 'nama_lengkap' => $data->nama_lengkap, 'kode_unik' => $data->kode_unik, 'tgl_booking' => $data->tgl_booking, 'jam_booking' => date('H:i:s', strtotime($data->created_at)), '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) { // } }