0

I keep getting the error "Missing argument 1 for App\Http\Controllers\Users::deleteMobileAssets()" . I am making a call from my frontend with Vue. When I check the headers, it seems correct but I'm not sure what is causing the error. I've tried wrapping imageType in brackets too: {imageType: imageType} but still same error.

deleteImage(imageType) {
    axios.post('/delete-mobile-assets', imageType);
}

 public function deleteMobileAssets($imageType)
{

}

1 Answer 1

1

POST data is included in the body of the request that way you are getting Missing argument 1. Try this

deleteImage(imageType) {
    axios.post('/delete-mobile-assets', {imageType:imageType});
}

public function deleteMobileAssets(Request $request)
{
  $request->imageType
}

Or if you want to implement DELETE method. have a look Delete Method in Axios, Laravel and VueJS

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.