What if you put that in static function of boot method in your model?
class UrModel extends \Eloquent {
public static $rules = array(
'name' => 'required|unique:players|alpha|between:2,30',
//'city' => 'integer|in:' . implode(',', array_keys(\Config::get('app.cities'))),
);
public static function boot() {
parent::boot();
$config = array(1,2,3,4);
self::$rules['city'] = 'integer|in:'.implode(',', $config);
}
}
yfktn said:
What if you put that in static function of boot method in your model?
Hmm I totally forgot about the boot. It did the trick for me :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community