adding temporary validation
wisepotato opened this issue · comments
you have taken out temporary validation, but how do I add anything to the errors inside the model? I also would like to validate relationships, but that is not available anymore.
Too bad you its out..
I assume you mean for the Laravel 4 version:
class TestModel extends Awareness\Aware\Model {
public static $rules = [
'email' => 'required|numeric'
]
}
$model = new Model();
$model->name = "Test Model";
$model->email = "test@test.com";
$model->save(); // false
// set validation overrides for the next save
$model->overrideRules(['email' => 'required|email'])->save(); // true
I am using the laravel 3 version, because of legacy code. any help for that?
For L3 you can refer to "Overriding Rules and Messages" section of the readme.