select box
This commit is contained in:
@@ -146,6 +146,31 @@ class AdminController extends Controller
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete card allocation history record.
|
||||
*/
|
||||
public function destroyAddCard(Request $request, int $id)
|
||||
{
|
||||
try {
|
||||
$this->adminService->destroyAddCard($id);
|
||||
if ($request->expectsJson()) {
|
||||
return response()->json([
|
||||
'success' => true,
|
||||
'message' => 'Xóa lịch sử cấp phát thẻ thành công.',
|
||||
]);
|
||||
}
|
||||
return redirect()->back()->with('success', 'Xóa lịch sử cấp phát thẻ thành công.');
|
||||
} catch (\Exception $e) {
|
||||
if ($request->expectsJson()) {
|
||||
return response()->json([
|
||||
'success' => false,
|
||||
'message' => $e->getMessage(),
|
||||
], 422);
|
||||
}
|
||||
return redirect()->back()->withErrors(['error' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset all cards for active users.
|
||||
*/
|
||||
|
||||
@@ -116,8 +116,8 @@ class UserController extends Controller
|
||||
|
||||
$this->userService->updateProfile(
|
||||
$user,
|
||||
$request->file('avatar'),
|
||||
$request->filled('new_password') ? $request->input('new_password') : null
|
||||
$request->validated(),
|
||||
$request->file('avatar')
|
||||
);
|
||||
|
||||
return redirect()->route('user.edit')->with('success', 'Cập nhật hồ sơ thành công');
|
||||
|
||||
Reference in New Issue
Block a user