title: Generating URL::route with parameter in Laravel 4
body: <p>I am having trouble getting getting my parameter of 'item id' to tack onto the end of my route being generated for my form action url.</p>
  
  <p>I have a page setup to 'update' an existing item. The routes looks something like this:</p>
  
  <pre><code>Route::get('/item/edit/{id}', array(
      'as' =&gt; 'item-edit',
      'uses' =&gt; 'ItemController@getEditItem',
  ));
  
  
  
  Route::post('/item/edit/{id}', array(
      'as' =&gt; 'item-edit-post',
      'uses' =&gt; 'ItemController@postEditItem',
  ));
  </code></pre>
  
  <p>and my ItemController contains these methods:</p>
  
  <pre><code>public function getEditItem($id) {
  
      $states = State::where('user_id', '=', Auth::user()-&gt;id)-&gt;get();
  
      $types = Type::where('user_id', '=', Auth::user()-&gt;id)-&gt;get();
  
      $item = Item::where('user_id', '=', Auth::user()-&gt;id)
              -&gt;where('id', '=', $id)
              -&gt;first();
  
      return View::make('items.edit')
              -&gt;with('item', $item)
              -&gt;with('states', $states)
              -&gt;with('types', $types);
  
  }
  
  public function postEditItem($id) {
  
      // Validate input for Item changes
      $validator = Validator::make(Input::all(),
          array(
              'label'    =&gt; 'required|min:3|max:128|unique:items,label,null,id,user_id,' . Auth::user()-&gt;id,
              'type_id'  =&gt; 'required|integer',
              'state_id' =&gt; 'required|integer',
          )
      );
  
      if( $validator-&gt;fails() ) {
  
          return Redirect::route('item-edit')
                 -&gt;withErrors($validator)
                 -&gt;withInput();
  
      } else {
  
          $item               = Item::find($id);
          $item-&gt;label        = Input::get('label');
          $item-&gt;type_id      = Input::get('type_id');
          $item-&gt;state_id     = Input::get('state_id');
          $item-&gt;save();
  
          return Redirect::route('item-create')
                 -&gt;with('global', 'Your new item has been edited successfully!');
  
      }
  
  }
  </code></pre>
  
  <p>The last piece of the puzzle is my <code>items.edit</code> view:</p>
  
  <pre><code>@extends('layout.main')
  
  @section('content')
  
      &lt;form action="{{ URL::route('item-edit-post', $item-&gt;id) }}" method="post" class="form-horizontal form-bordered" autocomplete="off"&gt;
          &lt;!-- some inputs and such --&gt;
      &lt;/form&gt;
  
  @stop
  </code></pre>
  
  <p>The action URL being generated here is wrong:</p>
  
  <pre><code>&lt;form method="POST" action="http://manageitems.com/item/edit/%7Bid%7D" accept-charset="UTF-8" hello="hello" class="form-horizontal form-bordered"&gt;
  </code></pre>
  
  <p>For some reason it is escaping my <code>{id}</code> in the route and not adding on the actual item ID on the end of the route. I have tried a few different ways of doing this and read through the route parameter docs, but I haven't made any progress. I also tried using Laravel's for builder like so:</p>
  
  <pre><code>{{ Form::open(array('action' =&gt; 'ItemController@postEditItem', $item-&gt;id, 'class'=&gt;'form-horizontal form-bordered')) }}
  </code></pre>
  
  <p>but this did the same thing. I am new to Laravel so this may be a simple problem that I am overlooking, any help is much appreciated.</p>