Skip to content

Instantly share code, notes, and snippets.

@syossan27
Created June 3, 2014 09:25
Show Gist options
  • Save syossan27/53cc6c2f44f3a43032e9 to your computer and use it in GitHub Desktop.
Save syossan27/53cc6c2f44f3a43032e9 to your computer and use it in GitHub Desktop.
Laravelのcheckbox小技 ref: http://qiita.com/syo/items/ff4dc5e75e279df5ac54
{{Form::checkbox('test', 1, true)}}
{{Form::checkbox('test', 2, true)}}
Log::debug(Input::all());
// ↑2つチェックしたのに中身がtest: "2"になってる!
{{Form::checkbox('test[]', 1, true)}}
{{Form::checkbox('test[]', 2, true)}}
Log::debug(Input::all());
// ↑中身がtest: [1, 2]になってる!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment