标签:
Route::get(‘test‘,‘VerController@index‘); Route::post(‘tosubmit‘,‘VerController@tosubmit‘);
class VerController extends Controller { //表单页面 public function index() { return view(‘from.from‘); } //表单提交验证 //这种是用自带的Request进行验证 // public function tosubmit(Request $request) // { // $this->validate($request, [ // ‘title‘=>‘required‘, // ‘content‘=>‘required|min:10‘ // ]); // return ‘success‘; // } //这种是用自己写的Request,用php artisan make:request FromRequest生成 public function tosubmit(Requests\FromRequest $request) { return ‘success‘; } }
public function authorize() { //别问为什么,就是要返回true return true; } public function rules() { return [ //这里写规则 ‘title‘=>‘required‘, ‘content‘=>‘required|min:10‘ ]; }
把en文件夹复制一份重命名为cn
然后在/config/app.php下修改
标签:
原文地址:http://www.cnblogs.com/xj76149095/p/5627817.html