first(); return response()->json($profile); } /** * Show the form for editing the specified resource. */ public function edit(string $id) { } /** * Update the specified resource in storage. */ public function update(Request $request) { $validated = $request->validate([ 'nama' => ['required', 'string', 'max:255'], 'email' => ['required', 'email'], 'telepon' => ['nullable', 'string'], 'alamat' => ['nullable', 'string'], 'kk' => ['nullable', 'string'], 'ktp' => ['nullable', 'string'] ]); $profile = Profile::where('user_id', Auth::id())->first(); $profile->update($validated); return response()->json($profile); } /** * Remove the specified resource from storage. */ public function destroy(string $id) { // } }