Search code examples
laravelpostgetcpanel

Getting 405 Error Method is not Allowed in Online Server (Laravel)


It works fine on my local server and computer when I upload it to the online server and whenever I try to update a field like description or sometimes when inserting I get 405 and says that method is not allowed. I used same method (POST) as in web.php and also in my view.

                        <form action="/updateannouncement" method="post" enctype="multipart/form-data">
                            @csrf
                            <input type="hidden" name="id" value="{{ $announce->id }}">

                                    <div class="form-group">
                                        <label class="col-form-label" for="title"><i class="fa fa-pen"></i> Announcement
                                            Title</label>
                                        <input type="text" name="title" class="form-control" value="{{ $announce->title }}" id="title"
                                            placeholder="Enter ..." required>
                                    </div>
                               

this is web.php


Route::post('/insertannouncement', 'announcementController@insert');
Route::post('/updateannouncement', 'announcementController@update')->middleware('restrict');

I realy want help on this guys!!!


Solution

  • Problem Solved!

    The Problem was in the CPanel in MODSecrity which I have to turn it off for my domain when done that error was gone.