I'm developing simple crude application using laravel 4.2. this is my controller method for edit/update.
class ProductsController extends BaseController{
public function getEdit($id){
$product=Products::find($id);
$this->layout->content=View::make('products.edit',compact('product'));
}
}
this is the part of edit.blade.php file
{{ Form::model($product, ['route' => ['products/update', $product->id], 'method' => 'patch']) }}
I define route for the ProductsController as follows in route.php file
Route::controller ( 'products', 'ProductsController');
when i try to edit product(http://localhost:8000/products/5/edit)
it says Route [products/update] not defined.
this is my edit link
<a class="btn btn-small btn-info" href="{{ URL::to('products/' . $product->id . '/edit') }}">Edit </a>
what is the reason for this error? i have define patchUpdate() function on product contraller.