auth()->user()->passwordEntries()->orderBy('title')->get(), 'certificates' => [], 'ssh_keys' => [], 'stats' => [ 'passwords' => auth()->user()->passwordEntries()->count(), 'certs' => 0, 'expiring' => 0, 'ssh_keys' => 0, ], ]); } public function store(Request $request) { $validated = $request->validate([ 'title' => 'required|string', 'username' => 'nullable|string', 'password' => 'required|string', 'url' => 'nullable|url', 'notes' => 'nullable|string', 'category' => 'nullable|string', ]); auth()->user()->passwordEntries()->create($validated); return back()->with('success', 'Password entry created.'); } public function reveal(PasswordEntry $password) { $this->authorize('view', $password); return response()->json(['password' => $password->getDecryptedPassword()]); } public function update(Request $request, PasswordEntry $password) { $this->authorize('update', $password); $password->update($request->except('_token')); return back()->with('success', 'Entry updated.'); } public function destroy(PasswordEntry $password) { $this->authorize('delete', $password); $password->delete(); return back()->with('success', 'Entry deleted.'); } }