Getting 404 error when submitting a form

Routes:

Route::post('orders/edit-order-content/{$id}', 'Admin\OrderController@addProduct')->name('addProductToOrder');
Route::resource('/orders', 'Admin\OrderController');

Controller:

public function addProduct($id){
  dd($id);
}

View:

{!! Form::open(['route' =>['addProductToOrder',$order->id], 'id'=>'editOrderContent']) !!}
{!! Form::label('product_id','Product ID') !!}<br>
{!! Form::input('text','product_id') !!}<br>
{!! Form::label('qty','Quantity') !!}<br>
{!! Form::input('number','qty',1,['min'=>'1'])!!}<br>
{!! Form::submit('Add product',['class'=>'btn btn-info ','id'=>'addProduct']) !!}
{!! Form::close() !!}

Why am I getting 404 page? I tried to do it with new controller, but also got 404 error...


ANSWERS:


So, the solutions is, you cannot use the $ sign in your routes as a variable:

Replace

Route::post('orders/edit-order-content/{$id}', 'Admin\OrderController@addProduct')->name('addProductToOrder‌​'); 

With

 Route::post('orders/edit-order-content/{id}', 'Admin\OrderController@addProduct')->name('addProductToOrder‌​');

You can't chain name() on certain versions, I would recommend defining it explicitly.

Route::post('orders/edit-order-content/{$id}', [
    'uses'  =>'Admin\OrderController@addProduct',
    'as'=>'addProductToOrder'
]);

Also as mentioned in another answer, remove the $


I think you are simply sending the form with get method instead of post.

{!! Form::open(['method'=>'post', 'route' =>['addProductToOrder',$order->id], 'id'=>'editOrderContent']) !!}


 MORE:


 ? JSP in /WEB-INF returns "HTTP Status 404 The requested resource is not available"
 ? Tomcat started in Eclipse but unable to connect to http://localhost:8085/
 ? Why is @font-face throwing a 404 error on woff files?
 ? Routing for custom ASP.NET MVC 404 Error page
 ? How to check if a URL exists or returns 404 with Java?
 ? Best way to implement a 404 in ASP.NET
 ? How can I create an error 404 in PHP?
 ? How to get MVC action to return 404
 ? Image Get Requests with AngularJS
 ? What is the proper way to send an HTTP 404 response from an ASP.NET MVC action?