我使用以下代码重定向到PHP中的页面.我需要设置自定义HTTP标头以与重定向一起传递.
header("Location: http://...");
Run Code Online (Sandbox Code Playgroud)
我该如何存档?
我有一个 Auth.Attempt 事件处理程序类,我检测用户的登录尝试以决定锁定用户的帐户。但是,当我尝试使用闪现消息将用户重定向到登录页面时,我发现重定向不起作用,仍然继续下一步。我想在事件发生时中断该过程并给出我的自定义警告消息。谁能帮我吗?多谢。
我的事件处理程序:
namespace MyApp\Handlers\Security;
use DB;
use Session;
use Redirect;
class LoginHandler
{
/**
* Maximum attempts
* If user tries to login but failed more than this number, User account will be locked
*
* @var integer
*/
private $max_attemtps;
/**
* Maximum attempts per IP
* If an IP / Device tries to login but failed more than this number, the IP will be blocked
*
* @var integer
*/
private $ip_max_attempts;
public function __construct()
{ …Run Code Online (Sandbox Code Playgroud)