Laravel Unknown Column ‘updated_at’

I’ve just started with Laravel and I get the following error:

Unknown column ‘updated_at’ insert into gebruikers (naam, wachtwoord,
updated_at, created_at)

I know the error is from the timestamp column when you migrate a table but I’m not using the updated_at field. I used to use it when I followed the Laravel tutorial but now that I am making (or attempting to make) my own stuff. I get this error even though I don’t use timestamps. I can’t seem to find the place where it’s being used. This is the code:

Controller

public function created()
{
    if (!User::isValidRegister(Input::all())) {
        return Redirect::back()->withInput()->withErrors(User::$errors);
    }

    // Register the new user or whatever.
    $user = new User;
    $user->naam = Input::get('naam');
    $user->wachtwoord = Hash::make(Input::get('password'));
    $user->save();

    return Redirect::to("https://stackoverflow.com/users");
}

Route

Route::get('created', 'UserController@created');

Model

public static $rules_register = [
    'naam' => 'unique:gebruikers,naam'
];

public static $errors;
protected $table="gebruikers";

public static function isValidRegister($data)
{
    $validation = Validator::make($data, static::$rules_register);

    if ($validation->passes()) {
        return true;
    }

    static::$errors = $validation->messages();

    return false;
}

I must be forgetting something… What am I doing wrong here?

5 Answers
5

Leave a Comment