codeigniter 4 delete redirect with data

return redirect()->to('/users')->with('message', 'User deleted successfully');
  1. redirect() function returns a new RedirectResponse instance to the specified URL.
  2. ->to('/users') method specifies the URL to redirect to.
  3. ->with('message', 'User deleted successfully') method sets session data for the next request. ```