/** * Creates a custom Form macro * @return void */ public function createMacroForm() { // Add a custom honeypot macro to Laravel's forms app('form')->macro('honeypot', function ($honey_name, $honey_time) { $o = new Honeypot(); return $o->getFormHTML($honey_name, $honey_time); }); }
/** * Register the honeypot form macro * * @param Illuminate\Html\FormBuilder|null $form * @return void */ public function registerFormMacro(FormBuilder $form = null) { $honeypotMacro = function ($honey_name, $honey_time) { $honeypot = new Honeypot(); return $honeypot->getFormHTML($honey_name, $honey_time); }; // Add a custom honeypot macro to Laravel's form if ($form) { $form->macro('honeypot', $honeypotMacro); } else { FormBuilder::macro('honeypot', $honeypotMacro); } }
/** * Decrypt the given time * * @param mixed $time * @return string|null * @static */ public static function decryptTime($time) { return \Msurguy\Honeypot\Honeypot::decryptTime($time); }