I suggest this free course here:
https://laracasts.com/series/30-days-to-learn-laravel-11
He covers routing, validation, etc.
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Hello, I have to use Laravel for a school project and I am having issues with the updating and destroying parts of a controller. Those are my edit, update and destroy functions
public function edit(Types $types)
{
return view('admin.types.edit', compact('types'));
}
public function update(TypeUpdateRequest $request, Types $type)
{
$type->name = $request->validated()['name'];
$type->colour = $request->validated()['colour'];
if ($request->hasFile('img')) {
$path = $request->file('img')->store('images/typesImages', 'public');
$type->image = $path;
}
$type->save();
return redirect()->route('admin.types.index');
}
public function destroy(Types $types)
{
$types->delete();
return redirect()->route('admin.types.index');
}
The problem is that, for some reason, the line "<form method="POST" action="{{ route('types.update', $types) }}"" in my edit.blade.php gets me a "Missing required parameter for [Route: types.update] [URI: admin/types/{type}] [Missing parameter: type]." error.
What confuses me is that I have another CRUD controller with the same edit page that I c/p'd from and it's working perfectly on the other one, but this one I can't edit nor delete.
Thank you for taking the time to read my question and sorry if my question is dumb.
Please or to participate in this conversation.