SQLSTATE [42S22]:找不到列:1054未知列'empstatus'

我是Laravel 7的初学者,正在使用两个表'empmast'和'empatten'。我显示了empmast的值(empid,empname),并使用相同的值连接了两个字段(empstatus,doa)。然后,我尝试将这些值推入“ Empatten”表。问题是这些值正试图保存在empmast instated empatten表中。请协助。

完成错误:

SQLSTATE[42S22]: Column not found: 1054 Unknown column 'empstatus' in 'field list'  
(SQL: insert into `empmast` (`empid`, `empname`, `empstatus`, `doa`, `updated_at`, `created_at`) values (2, Kirupa Shankar, Present, 17-05-2020, 2020-05-17 06:34:26, 2020-05-17 06:34:26))

EmpAttenController:

use App\Empatten;
use App\Empmast;
use Illuminate\Http\Request;

class EmpAttenController extends Controller
{
    public function store(Request $request, Empatten $empatten)
    {
        $member1 = $request->input('empid');
        $member2 = $request->input('empname');
        $member3 = $request->input('empstatus');
        $member4 = $request->input('doa');


        for ($i = 0; $i < count($member1); $i++) {

            $empatten->empid = $member1[$i];
            $empatten->empname = $member2[$i];
            $empatten->empstatus = $member3[$i];
            $empatten->doa = $member4;
            $empatten->save();
        }
    }
}

Empatten(型号):

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class Empatten extends Model
{
    protected $fillable = [
        'empid'     => 'array',
        'empname'   => 'array',
        'empstatus' => 'array',
        'doa'
    ];
}
评论