Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Usuario extends Eloquent{
- public static $table = 'usuario';
- public static $timestamps = false;
- /**
- * Save the model instance to the database.
- *
- * @return bool
- */
- public function save(){
- if(isset($this->password))
- $this->password = Hash::make($this->password);
- Parent::save(); // Here fails
- }
- public static function validate($data){
- return Validator::make($data, array(
- 'nome' => 'required|min:3|max:80',
- 'username' => 'required|min:3|max:20',
- 'password' => 'required|min:6|max:20'
- ));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment