时间:2021-07-01 10:21:17 帮助过:98人阅读
$student,
]);
}
// 添加页面
public function create(Request $request)
{
if($request->isMethod('POST')){
$data = $request->input('Student');
if(Student::create($data)){
**return redirect('student/index')->with('success','成功添加');**
}else{
return redirect()->back();
}
}
//session暂存数据
return view('student.create');
}
}
View
@if (Session::has('success'))
成功!{{Session::get('success')}}
@endif
控制器
$student,
]);
}
// 添加页面
public function create(Request $request)
{
if($request->isMethod('POST')){
$data = $request->input('Student');
if(Student::create($data)){
**return redirect('student/index')->with('success','成功添加');**
}else{
return redirect()->back();
}
}
//session暂存数据
return view('student.create');
}
}
View
@if (Session::has('success'))
成功!{{Session::get('success')}}
@endif
是不是中间件,没启用session
?