John Davidson

php - Why is shows to me "Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException The GET method is not supported for this route."

0 comments
Message:


I'm working on a multi language web project using Laravel 8.0. I have use the https://github.com/mcamara/laravel-localization package to change the language. Its only 3 main pages which are dashboard, register and login. The package works correctly on dashboard page, but in the register page it shows this: Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException The GET method is not supported for this route. Supported methods: POST.


This is web.php:



Route::group(
[
'prefix' => LaravelLocalization::setLocale(),
'middleware' => [ 'localeSessionRedirect', 'localizationRedirect', 'localeViewPath' ]
], function(){ //...

Route::get('/', function()
{
return redirect()->route('login');
});

Route::post('/register', 'App\Http\Controllers\RegisteredUserController@store')->name('register2');

Route::group(['middleware' => 'auth'],function (){
Route::get('/register-step2','\App\Http\Controllers\RegisterStepTwoController@create')
->name('register-step2.create');
Route::post('/register-step2','\App\Http\Controllers\RegisterStepTwoController@store')
->name('register-step2.post');

Route::group([ 'middleware' => ['auth:sanctum','verified','registered']], function() {
Route::get('/dashboard', '\App\Http\Controllers\DashboardController@index')->name('dashboard');
});
});

});

This is register blade:


<x-guest-layout>
<x-jet-authentication-card>
<x-slot name="logo">
<h1 class="text-white headersize px-3"> Sign up as a Coinshop Partner Below</h1>
</x-slot>
<x-jet-validation-errors class="mb-4"/>
<!-- Fields to complete Registration Step 1 -->
<form method="POST" action="{{ route('register2') }}">
@csrf
<div>
<x-jet-label for="country_id" value="{{ ('Choose your country')}}"/>
<select id="country_id" name="country_id"
class=' w-full border-gray-300 focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50 rounded-md shadow-sm'>
<option value="" disabled selected>Select Country</option>
<option value="Denmark">Denmark</option>
<option value="Mauritius">England</option>
</select>
</div>
...



My Answer:
It seems like your question is incomplete. Can you please provide more context or clarify what you are asking about PHP?

Rate this post

3 of 5 based on 5955 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us