第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定

為什么我的不是中文呢

//添加頁面
public function create(Request $request){
? ?if($request->isMethod('post')){
? ? ? ?$this->validate($request,[
? ? ? ? ? ?'Student.name'=>'required|min:2|max:20',
? ? ? ?'Student.age'=>'required|integer',
? ? ? ?'Student.sex'=>'required|integer',
? ? ? ?],['required'=>':attribute 為必填項',
? ? ? ?],['Student.name'=>'姓名']);
? ? ? ?$data=$request->input('Student');
? ? ? ?if(Student::create($data)){
? ? ? ? ? ?return redirect('student/index')->with('success','添加成功');
? ? ? ?}else{
? ? ? ? ? ?return redirect()->back();
? ? ? ?}

? ?}
? ?return view('student.create');
}

正在回答

1 回答

你的 “ ??'required'=>':attribute 為必填項', ?”這個后面多了個逗號 最后一個下標(biāo)不應(yīng)該有逗號!


$this->validate($request,

? ? ? ? ? ? ['Student.name'=>'required|min:2|max:23',

? ? ? ? ? ? ? ? 'Student.age'=> 'required|integer',

? ? ? ? ? ? ? ? 'Student.sex'=> 'required|integer'

? ? ? ? ? ? ],

? ? ? ? ? ? [

? ? ? ? ? ? ? ? 'required' => ':attribute 必填選項!',

? ? ? ? ? ? ? ? 'mix'=>':attribute 必須大于2個字符',

? ? ? ? ? ? ? ? 'max'=>':attribute 必須小于66個字符',

? ? ? ? ? ? ? ? 'integer'=>':attribute 必須為整數(shù)'

? ? ? ? ? ? ],

? ? ? ? ? ? [

? ? ? ? ? ? ? ? 'Student.name'=>'名 字',

? ? ? ? ? ? ? ? 'Student.age'=>'年 齡',

? ? ? ? ? ? ? ? 'Student.sex'=>'性 別'

? ? ? ? ? ? ]);


1 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

為什么我的不是中文呢

我要回答 關(guān)注問題
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號