Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

anuzpandey's avatar

The GET method is not supported for this route. Supported methods: PUT

I have a Laravel Application hosted on a Namecheap server. And I get this issue "The GET method is not supported for this route. Supported methods: PUT" which is weird.

I checked all of my code and locally if I try reproducing this issue, none appears. The issue is only on the server.

So, I tried hosting the same application on a different server on a different account. And on that server, the application works fine.

So is this our server issue??? Or is it Laravel?

View:

<form action="{{route('team.store')}}" method="POST" enctype="multipart/form-data" autocomplete="off">
	@csrf
	<div class="form-group">
			<label for="description">Content <code>*</code></label>
			<textarea class="form-control" rows="6" id="description" title="description" placeholder="Please enter your description here." name="description">{{old('description')}}</textarea>
		</div>

		<div class="form-group">
				<button type="submit" class="btn btn-primary">Save</button>
				<button type="reset" class="btn btn-danger">Reset</button>
		</div>
</form>

Routes:

Route::group(['prefix' => 'team', 'middleware' => ['can:isAdmin']], function () {
		Route::get('/', [TeamController::class, 'index'])->name('team.index');
		Route::get('/create', [TeamController::class, 'create'])->name('team.create');
		Route::post('/store', [TeamController::class, 'store'])->name('team.store');
		Route::get('/{id}/edit', [TeamController::class, 'edit'])->name('team.edit');
		Route::post('/update', [TeamController::class, 'update'])->name('team.update');
		Route::get('/{id}/delete', [TeamController::class, 'delete'])->name('team.delete');
});

Team Controller:

public function store(TeamRequest $request)
{
    $team = $this->teamRepository->addTeam($request->except('_token'));

    return $team
        ? $this->responseRedirect('team.index', 'Team successfully Created.', 'success')
        : $this->responseRedirectBack('Error while creating team.', 'error', true, true);
}

TeamRepository

public function addTeam(array $params)
{
    try {

        $collection = collect($params);

        $image = ($collection->has('image') && ($params['image'] instanceof UploadedFile))
            ? $this->uploadOne($params['image'], 'teams/', 500, 500)
            : null;

        $is_visible = $collection->has('is_visible') ? 1 : 0;

        $merge = $collection->merge(compact('image', 'is_visible'));

        return $this->create($merge->all());

    } catch (QueryException $exception) {
        throw new InvalidArgumentException($exception->getMessage());
    }
}

So these are the codes. Basically, every model has same tasks.

When adding or updating records like description. Some adds and updates without any issue. But on some content, the issue gets reproduced.

To be specific, content that does this is:

Mrs. Name Lasname is a professional researcher in the field of fundraising and project development. She has experience working with several International and National NGOs as a consultant and a full-time staff. She is now focusing on innovating Nepalese products for global markets. She had also worked as a Lecturer in different Colleges in Nepal. Her area of expertise is fundraising, project implementation, quality assurance, environment management, etc. She is a Lead Auditor for Quality Management System (ISO 9001), Environment Management System (ISO 14001), and Food Safety (ISO 22001).

Everytime I add this content on any of the field, I get MethodNotAllowedHttpException.

I have used Summernote as a WYSIWYG editor and thought this may have caused the issue and replaced it with TinyMCE and CKEditor too. But still, I get the same issue.

So I don't know what is going on here. If anyone came up with this issue and solved it. Help would be appreciated.

Thank you.

0 likes
8 replies
sr57's avatar

Have you look in your logs?

anuzpandey's avatar

Yes. I did and I saw nothing about the MethodNotFound exception.

sr57's avatar

Strange ...

Laravel logs: storage/logs/laravel.log

web server logs : if apache : /var/log/apache2/error.log

anuzpandey's avatar

Checked Laravel Logs. Nothing there.

Webserver logs I could not find. And I'm looking at it.

anuzpandey's avatar

Tried other things too, clearing cache, config, routes, views.

php artisan optimize:clear

Still the issue persists.

anuzpandey's avatar
anuzpandey
OP
Best Answer
Level 5

So, after talking to the Hosting Provider, this issue was due to some ModSecurity on their part. They disabled / whitelisted it (from what they told me). And now everything is working fine now.

Thank you @andyandy and @sr57 for your timely response.

Please or to participate in this conversation.