laravelcpanelhttp-status-code-405laravel-11

I keep getting 405 method not allowed error


I hosted my laravel project on cpanel and some of my post requests keeps returning 405 error.

I have tried clearing app cache

Route::post('subscribe/{package}', [UserSubscribeController::class, subscribe'])->name('subscribe');
<form method="post" action="{{ route('subscribe', $package->id) }}">
  @csrf
 <button type="submit" id="submit" class="btn my-2 btn-primary btn-lg px-4 btn-style">Subscribe</button>
</form>

Solution

  • The issue was from the hosting provider, I had to change hosting and it works fine.