any expert here ? This is a very strange problem I am facing.
I have my website hosted on an aws machine. The code was working absolutely fine there. Then it was shifted to another server and this strange problem staeted to appear.
I have a route to update a car
Route::put('vehicles/{vehicle}', 'VehicleController@update');
Edit form
{!! Form::model($vehicle, ['url' => ['backend/vehicles', $vehicle->id], 'method' => 'put','files' => true , 'class' => 'form-horizontal form-label-left', 'role' => 'form']) !!}
@include( 'backend.vehicles.form' )
{!! Form::close() !!}
Now here is where the strange behaviour start, whenever I try to update a car which was created prior to the server move, It shows me MethodNotAllowedHttpException in RouteCollection.php
But when I create a car and then updates this new car, Operation succeeds. Please help.
One more thing, In routeCollection.php where it matches a route for a request, It shows GET method for old car but put method for new car
public function match(Request $request){
// die($request->getMethod()); $routes = $this->get($request->getMethod());
$route = $this->check($routes, $request);
if (! is_null($route)) {
return $route->bind($request);
}
// If no route was found we will now check if a matching route is specified by
// another HTTP verb. If it is we will need to throw a MethodNotAllowed and
// inform the user agent of which HTTP verb it should use for this route.
$others = $this->checkForAlternateVerbs($request);
if (count($others) > 0) {
return $this->getRouteForMethods($request, $others);
}
throw new NotFoundHttpException;
}
Please anyone.