Saturday, March 4, 2017

Laravel Defender (Spam protection) using OLD and display errors

I'm using https://github.com/thomastkim/laravel-spam-prevention but I want to display validator messages and old content back to user but Idk if it's possible if names are randomized. What I'm currently doing: Example of input:

<div class="form-group">
      <label for="" class="control-label">First name:</label>
      <input type="text" name="" value="" class="form-control" id="">
      <span class="text-danger">  </span>
    </div>

and in my request there is rule:

Defender::get('firstname') => 'required',

and there is message:

 Defender::get('firstname').'.required' => 'You must enter your first name',

But obviously when form gets submited this won't be same as before... So any idea what I should do here in order to display messages to user and get old input ?



via Michael

Advertisement