studentcontrtoller代碼
if (Student::create($data)) {
return redirect('student/index')->with('success', '添加成功!');
} else {
return redirect()->back()->with('error', '添加失敗!');;
}
if (Student::create($data)) {
return redirect('student/index')->with('success', '添加成功!');
} else {
return redirect()->back()->with('error', '添加失敗!');;
}
2018-01-11
將路由的的中間鍵刪掉 還是沒有顯示成功的消息
不刪也不行
版本5.2.45
Route::group([],function (){
Route::get('student/index',['uses'=>'StudentController@index']);
Route::any('student/create',['uses'=>'StudentController@create']);
Route::any('student/save',['uses'=>'StudentController@save']);
});
不刪也不行
版本5.2.45
Route::group([],function (){
Route::get('student/index',['uses'=>'StudentController@index']);
Route::any('student/create',['uses'=>'StudentController@create']);
Route::any('student/save',['uses'=>'StudentController@save']);
});
2018-01-11
使用中間件后 刪掉session后還會出來,且flash,forget,pull均無效。
//使用中間件
/*Route::group(['middleware'=>['web']],function (){
Route::any('session1',['uses'=>'StudentController@session1']);
Route::any('session2',['uses'=>'StudentController@session2']);
});*/
去掉之后恢復正常。求解。
//使用中間件
/*Route::group(['middleware'=>['web']],function (){
Route::any('session1',['uses'=>'StudentController@session1']);
Route::any('session2',['uses'=>'StudentController@session2']);
});*/
去掉之后恢復正常。求解。
2017-12-21
關于以post提交,報報TokenMismatchException錯誤,
可以在表單中添加 :
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
或者在 中間件 VerifyCsrfToken 中的 $except 屬性中添加 路由
protected $except = [
'student/save'
];
可以在表單中添加 :
<input type="hidden" name="_token" value="{{ csrf_token() }}"/>
或者在 中間件 VerifyCsrfToken 中的 $except 屬性中添加 路由
protected $except = [
'student/save'
];
2017-12-13
`created_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '新增時間',
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '修改時間',
還是喜歡這種類型的直接int(11)查詢數據庫不能直接看到具體時間
`updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00' COMMENT '修改時間',
還是喜歡這種類型的直接int(11)查詢數據庫不能直接看到具體時間
2017-12-07