Mysql
 sql >> Database >  >> RDS >> Mysql

Come memorizzare i dati nel database in LARAVEL 5.2

Sostituisci store come di seguito:

public function store(Request $request)
{
    $this->validate($request, [
        'job' => 'required',
        'machine' => 'required'
    ]);

    $spkAdmin = new SpkAdmin();
    //On left field name in DB and on right field name in Form/view
    $spkAdmin->user_job = $request->input('job');
    $spkAdmin->machine = $request->input('machine');
    $spkAdmin->save();
}