我正在尝试从 laravel 播种机插入值。插入了所有其他表数据,但我卡在 input_fields 表上。即使它在我的本地 Mamp 服务器上运行也绝对没问题,但是当我尝试在 Live 服务器上运行时出现错误,但正如我所见,我的数据库中存在表名。我也运行“composer dumpautoload”,但仍然面临同样的问题。
输入框.php
namespace App;
use Illuminate\Database\Eloquent\Model;
class inputField extends Model
{
protected $table = 'input_fields';
public function dropDown()
{
return $this->belongsTo('App\dropDown', 'drop_id');
}
}
2017_10_13_093801_input_Fields
Schema::create('input_Fields', function (Blueprint $table) {
$table->increments('id');
$table->string('field_name');
$table->string('cat_id');
$table->string('description');
$table->string('drop_id')->nullable();
$table->rememberToken();
$table->timestamps();
});
InputFieldsTableSeeder.php
$inputvalue = new inputField();
$inputvalue->field_name = 'Bilirubin Total';
$inputvalue->cat_id = '1';
$inputvalue->description = '0.0 - 1.2';
$inputvalue->save();
哈士奇WWW