Created
March 25, 2015 09:59
-
-
Save wedojava/41296a19a759a57c3d6d to your computer and use it in GitHub Desktop.
Revisions
-
wedojava created this gist
Mar 25, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ 放个例子: 视图:{!!Form::select('difficulty', $difficulties)!!} 控制器: public function edit($id) { return view('admin.questions.edit') ->withQuestion(Question::find($id)) ->withDifficulties(Difficulty::lists('name', 'id')); } 关键问题在于这一句:Difficulty::lists('name', 'id')