表单中的Post方法可以在本地运行,但是当我将相同的代码克隆到VM时,它将无法正常工作。
Route::get('AnswerType/Save','Admin\AnswerTypeController@store'); //route
{!! Form::open(['url' => '/master-data/AnswerType/', 'method'=>'POST', 'class' => 'form-horizontal']) !!} //form
public function store(Request $request) //controller
{
// validate
request()->validate([
'form.AnswerTypeName' => ['required', 'max:250'],
]);
// save
$security_group = AnswerType::create($request->form);
// msg
session()->flash('message-success', 'The Answer type was successfully created.');
// redirect
return redirect('/master-data/AnswerType/View');
}