ardent icon indicating copy to clipboard operation
ardent copied to clipboard

Fighting spam comments

Open stlouisweb opened this issue 11 years ago • 1 comments

Is there a preferred or built-in way of combating spam comments when validating forms with Ardent? I've tried to use https://github.com/msurguy/Honeypot with the valdation rules in my model and the my_time field won't pass validation.

stlouisweb avatar Aug 04 '14 19:08 stlouisweb

You just need to set the additional purge fields e.g.

function __construct($attributes = array()) {
  parent::__construct($attributes);
  $this->purgeFilters[] = function($key) {
    $purge = array('my_time', 'my_name');
    return ! in_array($key, $purge);
  };
}

Also put them in your fillable property:

protected $fillable = array('my_time', 'my_name', ..........);

This did the trick for me.

heavysumo avatar Feb 10 '15 15:02 heavysumo