Closed usman-xs4arabia-dev closed 2 years ago
In routes.php you should update your urls From Route::get('/edit_post_toggle/{blogPostId}', 'BinshopsAdminController@edit_post_toggle') ->name('binshopsblog.admin.edit_post_toggle');
Route::patch('/edit_post/{blogPostId}', 'BinshopsAdminController@update_post') ->name('binshopsblog.admin.update_post');
To Route::post('/edit_post_toggle/{blogPostId}', 'BinshopsAdminController@edit_post_toggle') ->name('binshopsblog.admin.edit_post_toggle');
Route::post('/edit_post/{blogPostId}', 'BinshopsAdminController@update_post') ->name('binshopsblog.admin.update_post');
And then in edit_post.blade.php remove @method("patch") And update this jquery line $("#edit-post-form").attr("method", "get"); to $("#edit-post-form").attr("method", "post");
Just these two updates nothing else all the things will work normally no need for major changes.
Hopefully you will understand the problem and resolve it asap.
@usman-xs4arabia-dev thanks for reporting. We will have an update soon.
thanks for your contribution. PR merged: https://github.com/binshops/laravel-blog/pull/65
You guys are using patch method while editing post. When you change the language the whole content of the post is coming with the url which can be problematic for server because we can not specify the length of the url. If the content of the blog will increase it will cause Url too long, length exceeded error. I would recommend instead of get use post method. Because I'm facing this issue on our live server. Thanks