You are posting to the same URL?
action="#"
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
The POST method is not supported for this route. Supported methods: GET, HEAD, PUT, PATCH, DELETE. this is my create.blade.php @extends('layouts.app')
@section('content')
@include('layouts.bread_crumb', ['title' => '', 'param1' => request()->segment(1), 'param2' => request()->segment(1)])
<div class="card">
<div class="card-body">
<div class="form-validation">
<form class="form-validate" action="#" method="post">
@include('admins.levels.field')
</form>
</div>
</div>
</div>
</div>
</div>
You are posting to the same URL?
action="#"
@tykus what should i do there
@olel I don't know... what are you trying to achieve? Currently you have defined a GET Route for the current URL; your form is attempting to POST to that URL; so, you either can specify a different action, or make a POST Route to the same URL.
@olel can you provide your routes which you have defined please ?
@folium <?php
use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Route; use App\Http\Controllers\DayController; use App\Http\Controllers\TimeController; use App\Http\Controllers\GradeController; use App\Http\Controllers\LevelController; use App\Http\Controllers\ShiftController; use App\Http\Controllers\ClassesController; use App\Http\Controllers\SectionController; use App\Http\Controllers\SessionController; use App\Http\Controllers\SubjectController;
/* |-------------------------------------------------------------------------- | Web Routes |-------------------------------------------------------------------------- | | Here is where you can register web routes for your application. These | routes are loaded by the RouteServiceProvider within a group which | contains the "web" middleware group. Now create something great! | */
Route::get('/', function () { return view('welcome'); });
Auth::routes();
Route::prefix('admin')->group(function(){
Route::view('/', 'admins.academics.index')->name('academics');
Route::resource('classes', ClassesController::class);
Route::resource('grades', GradeController::class);
Route::resource('levels', LevelController::class);
Route::resource('days', DayController::class);
Route::resource('times', TimeController::class);
Route::resource('shifts', ShiftController::class);
Route::resource('subjects', SubjectController::class);
Route::resource('sessions', SessionController::class);
Route::resource('sections', SectionController::class);
});
Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
@tykus am trying to submit a details
@olel what does this mean?
am trying to submit a details
I would guess (based on the included Blade partial) that you are adding a Level resource? So the form should submit to /levels - you can use the route helper:
<form class="form-validate" action="{{ route('levels.store') }}" method="post">
@include('admins.levels.field')
</form>
@tykus included that and got an error 419 PAGE EXPIRED
@tykus have done exactly this if i refresh the page i still have the error the post method is not supported
@olel you get a The POST method is not supported for this route error message whenever you refresh a page??
@tykus when i click the submit button i have the code in github can i share the link you check
@olel what does the controller's store action code look like?
@tykus are you talking about controller.php or storecontroller.php
@olel the LevelController's store method
@tykus <?php
namespace App\Http\Controllers;
use App\Jambasangsang\Service\levels\levelService; use App\Models\Level; use Illuminate\Contracts\View\View; use Illuminate\Http\RedirectResponse; use Illuminate\Http\Request;
class LevelController extends Controller {
public function index(): View
{
return view('admins.levels.index', ['levels' => Level::get()]);
}
public function create(): View
{
return view('admins.levels.create');
}
public function store(Request $request, levelService $levelService): RedirectResponse
{
$this->validated($request);
$levelService->storelevelData(new level(), $request);
return redirect()->route('levels.index');
}
public function show(Level $level): View
{
return view('admins.levels.show', compact('level'));
}
public function edit(Level $level): View
{
return view('admins.levels.edit', compact('level'));
}
public function update(Request $request, Level $level): RedirectResponse
{
return redirect()->route('levels.index');
}
public function destroy(Level $level): RedirectResponse
{
return redirect()->route('levels.index');
}
protected function validated($request)
{
return $this->validate(
$request,
[
'level_name' => 'required|max:100',
'level_status' => 'required|min:1',
'description' => 'nullable|max:200',
]
);
}
}
@olel that looks okay. Are you actually getting into the store method at all?
@tykus i see no error now but its not getting in the store method. it reloades just in the same page
@olel Do you have validation errors that you are not displaying?
<form class="form-validate" action="{{ route('levels.store') }}" method="post">
@csrf
@include('admins.levels.field')
</form>
@dump($errors->all())
@olel That is a validation error!!!!
The level name field is required.
You have submitted the form with invalid data, so you get redirected back with validation errors!
This is Laravel 101 - have you checked out the Laravel from Scratch series???
@tykus am now confused dont know what to do next you have seen my codes how will i fix things when i click submit i see it added on the list.ok i created a new level when i click i enter the page where i want feed the details when i click submit that error pops out
@olel the level_name field is required - that is as explicit as a message can be.
Why is level_name empty/missing? Again, I cannot see the form markup; is there an input field named level_name?
@tykus i have an input level name not level_name
@olel right, but the validation rules says 'level_name' => 'required|max:100',
Can you just share your view partial code????
@tykus not getting you. kindly reframe
@olel show the form
@tykus its under??
@olel under what?!?!
Please or to participate in this conversation.