Support the ongoing development of Laravel.io →
Database Forms Installation
Last updated 2 years ago.
0

Hey LT :) Check what do You see by running this in terminal:

php artisan route:list

You should get all registered routes and it might help some times to find some typo or somthing :)

0

@laimonassutkus, make sure that the request header type is of type DELETE. That error seems like a wrong header type would kick off. Especially when you used Route::resource() to generate the route.

If you can't change the request type to DELETE then you might need to add a custom POST route that handles the deletion.

0

So the issue was with my databases id column. There was two choices:

  1. make id column "id", not "ID"
  2. in this place "$product->id" change to "$product->ID"

Thank you for your answers ;)

0

I have a related question.

I have this in my controller:

class UserController extends Controller {

	public function index( Request $request ) {

	}

	public function create()
	{

	}

	public function store(UserCreateRequest $request) {

	}

	public function show( $id ) {


	}

	public function edit($id)
	{

	}

	public function update(UserUpdateRequest $request, $id)
	{

	}

	public function destroy($id)
	{

	}
}

Now, I want to use an UserDeleteRequest request object in method destroy(), like:

	public function destroy(UserDeleteRequest $request, $id)
	{

	}

But somehow this is prevented or even skipped. It does not throw an error or exception and XDebug will not even enter the method when I set a breakpoint in the top of the method.

Is this signature wrong? Is Laravel checking this signature somehow and how can I circumvent this?

0

have you CREATED UserDeleteRequest? and if so what does that contain.. that is most likely why its failing...

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.