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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user