Skip to content

Instantly share code, notes, and snippets.

@jackfruh
Created September 29, 2015 02:23
Show Gist options
  • Select an option

  • Save jackfruh/05f4087b38dc984292aa to your computer and use it in GitHub Desktop.

Select an option

Save jackfruh/05f4087b38dc984292aa to your computer and use it in GitHub Desktop.

Revisions

  1. jackfruh created this gist Sep 29, 2015.
    6 changes: 6 additions & 0 deletions controllerthatpopulatesSelect.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    public function create()
    {
    //note the 'lists' command and the two fields, the name to be displayed, and the key:
    $events = Event::lists('event_name', 'id');
    return view('admin.presentations.create')->with('events', $events);
    }
    4 changes: 4 additions & 0 deletions selectinaform.blade.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    <div class="form-group">
    {!! Form::label('event_id', 'event_id') !!} <br/>
    {!! Form::select('event_id',$events) !!}
    </div>