I'm using Laravel 5.2 and when I enter data it wants to return the last, but at the moment I want to insert and know if the operation was successful. My function in controller
looks like this:
public function cadastrar(),
{
$codigo= Request::input('codigo');
$codigo1 = Request::input('codigo1');
$model= new ModelCriado();
$model->CD_SEQUENCIA = "SEQUENCIA.NEXTVAL";
$model->CD_CODIGO = $codigo;
$model->CD_CODIGO1 = $codigo1;
$model->save();
return response()->json( array( "response" => 1 ) );
}
But he is giving this message:
Error Code: 904 Error Message: ORA-00904: "ID": invalid identifier Position: 128 Statement: insert into model values (: p0,: p1,: p2) returning id into: p3 Bindings: [SEQ_MODEL.NEXTVAL, 759,123,0]
My table only has 3 columns
CD_SEQUENCIA, CD_CODIGO, CD_CODIGO1
How do I resolve this?
EDITION 1
class ModelCriado extends Model
{
protected $table = "model_criado";
public $timestamps = false;
}