Skip to content

Instantly share code, notes, and snippets.

@burakerdem
Last active August 29, 2015 14:02

Revisions

  1. burakerdem renamed this gist Jun 18, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  2. burakerdem revised this gist Jun 18, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions usage.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    {{ Form::countrySelect('country') }}
  3. burakerdem created this gist Jun 18, 2014.
    7 changes: 7 additions & 0 deletions helper.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,7 @@
    // Taken from http://chrishayes.ca/blog/code/laravel-4-dry-views-form-html-macros
    Form::macro('countrySelect', function($name, $selected = 0, $options = [])
    {
    $countries = [0 => 'Select Country'] + Country::remember(60)->get()->lists('name', 'id');

    return Form::select($name, $countries, $selected, $options);
    });