siakad-itm/app/Http/Controllers/Admin/Settings/SecurityController.php
Yoga Pangestu 70d37741ef
Some checks failed
tests / ci (pull_request) Has been cancelled
Refactor admin settings structure and implement profile and security management
- Moved profile and security settings from the general settings route to a dedicated admin settings route.
- Created new components and pages for managing user profile and security settings.
- Updated user menu to link to the new admin settings pages.
- Removed old settings pages and routes that are no longer in use.
- Added tests for profile and security settings functionality.
2026-08-25 17:57:47 +07:00

38 lines
949 B
PHP

<?php
namespace App\Http\Controllers\Admin\Settings;
use App\Http\Controllers\Controller;
use App\Http\Requests\Admin\Settings\PasswordUpdateRequest;
use Illuminate\Http\RedirectResponse;
use Illuminate\Validation\Rules\Password;
use Inertia\Inertia;
use Inertia\Response;
class SecurityController extends Controller
{
/**
* Show the user's security settings page.
*/
public function edit(): Response
{
return Inertia::render('admin/settings/security', [
'passwordRules' => Password::defaults()->toPasswordRulesString(),
]);
}
/**
* Update the user's password.
*/
public function update(PasswordUpdateRequest $request): RedirectResponse
{
$request->user()->update([
'password' => $request->password,
]);
Inertia::flash('toast', ['type' => 'success', 'message' => 'Kata sandi berhasil diperbarui.']);
return back();
}
}