Answer the question
In order to leave comments, you need to log in
Laravel FirstOrCreate Integrity constraint violation?
There is a ParamsValue model:
Schema::create('params_values', function (Blueprint $table) {
$table->increments('id');
$table->integer('param_id')->unsigned();
$table->string('name');
$table->timestamps();
$table->foreign('param_id')
->references('id')
->on('params')
->onUpdate('cascade')
->onDelete('cascade');
});
$param_value = ParamsValue::firstOrCreate(['id' => $id, 'param_id' => $param_id]);
$param_value->param_id = $param_id;
$param_value->name = $name;
$param_value->save();
MassAssignmentException in Model.php line 424:
id
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question