I'm trying to do a store, a simple and basic store.
And I keep getting the error
The GET method is not supported for this route. Supported methods: POST.
My project is in Laravel 6, and here's the code:
web.php:
Route::post('store', 'enviarCurriculum\EnviarCurriculumController@store')
->name('store');
EnviarCurriculumController.php
public function store(StoreEnviarCurriculumPost $request)
{
EnviarCurriculum::create($request->all());
return view('mensaje_inscripcion');
}
StoreEnviarCurriculumPost
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
class StoreEnviarCurriculumPost extends FormRequest
{
public function authorize()
{
return true;
}
public function rules()
{
return [
'nif' => 'required',
];
}
}
enviar_curriculum.blade.php
<!DOCTYPE html>
<html lang="es">
// ...
<form action="{{ route('store') }}" method="POST" enctype="multipart/form-data">
@csrf
<label>NIF</label>
<input type="text" name="nif" value="{{ old('nif') }}">
@error('nif')
<div style="color:white; background-color:red;">{{ $message }}</div>
@enderror
<label>Name</label>
<input type="text" name="name" value="{{ old('name') }}">
<input type="submit" class="enviar-formulario" value="Enviar">
</form>
//...
</html>
I tried to clear all the cache, routes, etc... and nothing, ALWAYS the same error.
Man, what's happening???