I am trying to post a form using jQuery $.post method but I am getting MethodNotAllowedHttpException error in Laravel framework. I understand that there is some mismatch in the type of request going to route/controller but I am unable to figure out where.
jQuery Call
$.post("create", $("#myForm").serialize(), function(data) {
var json=JSON.parse(data);
console.log(json);
});
Controller
class create extends Controller
{
//
public function createRecord(){
$test="test";
return $test;
}
}
Routes (web.php)
Route::post('create',array('uses'=>'create@createRecord'));