USA State List for Blade

Created on: March 15, 2017   |   Last Updated on: July 24, 2017

USA State List for Blade Templates

Finding a state list in HTML options is usually easy. Type in a search into Google and within a few clicks, success. Today that's where I found myself, looking for a state list, but this time I needed it for a blade template. I found nothing. I was left with typing it all instead of copy & paste. Dreadful, I know. NEVER AGAIN!

This list is not only for my benefit but your's also. Why type out what another has already typed. At the time of this, I am using Laravel 5.3 and it doesn't come with form helpers so it has been pulled in with the Laravel Collective. That can be added to your project by following their guide to install it into your own Laravel project.

This list is for a select field, listing all 50 States of the United States of America. If you would like to add to the list please comment below your suggestion.

{{ Form::select('state', [
    'AL' => 'Alabama',
    'AZ' => 'Arizona',
    'AR' => 'Arkansas',
    'CA' => 'California',
    'CO' => 'Colorado',
    'CT' => 'Connecticut',
    'DE' => 'Delaware',
    'DC' => 'District of Columbia',
    'FL' => 'Florida',
    'GA' => 'Georgia',
    'HI' => 'Hawaii',
    'ID' => 'Idaho',
    'IL' => 'Illinois',
    'IN' => 'Indiana',
    'IA' => 'Iowa',
    'KS' => 'Kansas',
    'KY' => 'Kentucky',
    'LA' => 'Louisiana',
    'ME' => 'Maine',
    'MA' => 'Massachusetts',
    'MI' => 'Michigan',
    'MN' => 'Minnesota',
    'MS' => 'Mississippi',
    'MO' => 'Missouri',
    'MT' => 'Montana',
    'NE' => 'Nebraska',
    'NV' => 'Nevada',
    'NH' => 'New Hampshire',
    'NJ' => 'New Jersey',
    'NM' => 'New Mexico',
    'NY' => 'New York',
    'NC' => 'North Carolina',
    'ND' => 'North Dakota',
    'OH' => 'Ohio',
    'OK' => 'Oklahoma',
    'OR' => 'Oregon',
    'PA' => 'Pennslyvania',
    'RI' => 'Rhode Island',
    'SC' => 'South Carolina',
    'SD' => 'South Dakota',
    'TN' => 'Tennessee',
    'TX' => 'Texas',
    'UT' => 'Utah',
    'VT' => 'Vermont',
    'VA' => 'Virginia',
    'WA' => 'Washington',
    'WV' => 'West Virginia',
    'WI' => 'Wisconsin',
    'WY' => 'Wyoming',],
    null, ['placeholder' => 'State/Province'])

After adding this to your code a simple search & replace can convert all of the >'s into >.

Posted In: Web Development