LaravelではEloquentでfillでアップデートしようとした時、
fillable で更新カラムが許可されてないと、下記のエラーが出ます。
Add [key] to fillable property to allow mass assignment on
$ples = new Plesk; $plesk = 'plesk_license'; $ret = $plesk->select()->where('id', $id)->first(); $ret->fill(['plesk_key' => $this->keyNumber, 'keyfile' => $this->key]); $ret->timestamps = false; $res = $ret->save();
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class Plesk extends Model
{
public $connection = ''; public $table = ''; public $fillable = ['plesk_key','key_num','keyfile','key_file'];
}