public function __construct($options = null) { //it's not associative, so this means the options is the list if (array_keys($options) === range(0, count($options) - 1)) { $options = array('list' => $options); } parent::__construct($options); }
/** * Constructor takes a single value and not an array. It will set the 'equals' options * to this value. */ public function __construct($options = null) { //not an array, so we assume $options is the token if (!is_array($options)) { $options = array('token' => $options); } parent::__construct($options); }
public function __construct($data) { $this->rules = array('email' => 'required|email|unique:customers'); parent::__construct($data); }
public function __construct($data) { $this->rules = array('quantity' => 'required|integer|min:1', 'amount' => 'required|numeric|min:0', 'postage' => 'required|numeric|min:0'); parent::__construct($data); }