get("MarkupGoogleRecaptcha"); wire()->addHookProperty('Page::captcha', function($event) use ($captcha) { $event->return = $captcha; }); wire()->addHookAfter('Page::render', function($event) { $template = $event->object->template; $page = $event->object; if($template == 'admin' && !wire('user')->isLoggedin()) { $event->return = str_freplace('', $page->captcha->render() . '', $event->return); $event->return = str_lreplace('', $page->captcha->getScript() . '', $event->return); } }); wire()->addHookAfter('Session::authenticate', function($event) { $page = wire('page'); $template = $page->template; if($template == 'admin') { if($page->captcha->verifyResponse() == false) { wire('session')->logout(); wire('session')->redirect(wire('config')->urls->admin); } } });*/