colbyr / aware

self-validating models for Laravel\Eloquent

Home Page:http://bundles.laravel.com/bundle/aware

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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?