0

Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException The GET method is not supported for this route. Supported methods: POST.

This is the error throwing on server but on my localhost there are no errors.

<form action="/update-enquiry/{{$msgs->id}}/" method="POST" class="form-horizontal row-fluid">

<!-- <input type="hidden" name="_METHOD" value="PUT"> -->
@csrf
<div class="control-group">
        <label class="control-label" for="basicinput">Name</label>
        <div class="controls">
            <input type="text" id="basicinput" value="{{$msgs->name}}" name="name" class="span8" disabled>
        </div>
</div>

<div class="control-group">
        <label class="control-label" for="basicinput">Place</label>
        <div class="controls">
            <input type="text" id="basicinput" value="{{$msgs->place}}" name="place" class="span8" disabled>
        </div>
</div>

<div class="control-group">
        <label class="control-label" for="basicinput">Phone</label>
        <div class="controls">
            <input type="text" id="basicinput" value="{{$msgs->phone}}" name="phone" class="span8" disabled>
        </div>
</div>
<div class="control-group">
        <label class="control-label" for="basicinput">Course</label>
        <div class="controls">
            <input type="text" id="basicinput" value="{{$msgs->course}}" name="course" class="span8" disabled>
        </div>
</div>
<div class="control-group">
        <label class="control-label" for="basicinput">Date</label>
        <div class="controls">
            <input type="text" id="basicinput" value="{{$msgs->created_at}}" name="date" class="span8" disabled>
        </div>
</div>
<div class="control-group">
    <label class="control-label" for="basicinput">Status</label>
    <div class="controls">
        <select tabindex="1" data-placeholder="Select here.." class="span8 required" required name="status">
                <option value="{{$msgs->position->id}}" selected>{{$msgs->position->status}}</option>
            @foreach( $positions as $stat)
                <option value="{{$stat->id}}">{{$stat->status}}</option>
            @endforeach
        </select>
    </div>
</div>

<div class="control-group">
    <label class="control-label" for="basicinput">Remark</label>
    <div class="controls">
        <textarea class="span8" name="remarks" rows="5">{{$msgs->remarks}}</textarea>
    </div>
</div>

<div class="control-group">
    <div class="controls">
        <button type="submit" class="btn">OK</button>
    </div>
</div>

</form>

this is my form. As you can see only the remark input is what im updating. which works perfectly fine on my computer with the method spoofing (which I've commented out to check if it was the cause) and without it.

Route::middleware(['auth'])->group(function(){

        Route::post('/update-enquiry/{id}',     'AdminController@statusUpdate');
        Route::get('/show-unread',              'AdminController@ShowUnread');
        Route::get('/show-by-status/{id}',      'AdminController@ShowByStatus');
        Route::get('/delete-status/{id}',       'AdminController@DeleteStatus');
        Route::get('/message-delete/{id}',      'AdminController@DeleteMessage');
});

this is my route group and to be exact

Route::post('/update-enquiry/{id}',     'AdminController@statusUpdate');

is my route. what could be the problem?

brass monkey
  • 5,841
  • 10
  • 36
  • 61
safwan
  • 3
  • 1
  • `php artisan route:clear`? – Salman Zafar Jan 10 '20 at 13:06
  • tried that. still error. @SalmanZafar – safwan Jan 10 '20 at 13:12
  • 1
    It's a long shot, but maybe try `php artisan view:clear` too (on the server ofcourse). Also make sure the HTML output on the server is what you expect with the correct HTTP method. You can also check using your browser developer tools if there is a POST request being made and where to, that might give you the hints you need to hunt this bug down. – Alex Jan 10 '20 at 13:29
  • How did you deploy the code to the server? Are you running the route:clear command on the server(not local)? – Techno Jan 10 '20 at 14:10
  • What OS is your server running? – Rwd Jan 10 '20 at 14:11

0 Answers0