i'm started in laravel 5. And when I try to insert a row in a table, I'm getting this error:SQLSTATE[42S22]: Column not found: 1054 Unknown column 'updated_at' in 'field list' (SQL: insert into usuarios
(nombre_usuario
, updated_at
, created_at
) values (adreina, 2019-09-17 01:16:18, 2019-09-17 01:16:18))
I have this in wep.php
Route::get("/insertarEloquent", function(){
$usuarios = new \App\Usuario;
$usuarios->nombre_usuario = "adreina";
$usuarios->save();
});
And that is my model:
use Illuminate\Database\Eloquent\Model;
class Usuario extends Model
{
protected $table = "usuarios";
}
the table is called "usuarios" and if I use the method all() I can get the rows information without problems
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire