This is a simple problem. When I call save()
on my model, the columns are not getting added to the database. Here is my model:
class User extends Eloquent implements UserInterface, RemindableInterface {
use UserTrait, RemindableTrait;
protected $table = 'users';
protected $hidden = array('password', 'remember_token');
public $email; ## string (used as username)
public $name; ## string
public $address; ## string
public $phone; ## string nullable
}
and here's the code to add the row
$data=Input::all();
if ($data['password'] != $data['confirm-password']){
return Redirect::to('/register');
}
$user = new User;
$user->email=$data['email'];
$user->password=Hash::make($data['password']);
$user->name=$data['first']." ".$data['last'];
$user->address=$data['street'].", ".$data['city'].", ".$data['state']." ".$data['zip'];
$user->phone=$data['phone'];
$user->save();
echo "<pre>";
var_dump($user);
echo "</pre>";
The var_dump
is outputting the proper values in the model. Every field in the Model matches exactly the name of the column in the database. The password hash is getting added and a new row is being created, but every other column is showing up empty. What am I doing wrong?