Skip to content
Advertisement

undefined variable reimage laravel

I am trying to crud the image but it say undefined variable reimage code: CategoryController

JavaScript

}

web.php

JavaScript

add.blade.php **

JavaScript

and I am trying to make new name for the photo as the name is time+the orginal name ml> and I am trying to make new name for the photo as the name is time+the orginal name ml> and I am trying to make new name for the photo as the name is time+the orginal name ml> and I am trying to make new name for the photo as the name is time+the orginal name ml> and I am trying to make new name for the photo as the name is time+the orginal name

**

Advertisement

Answer

You are getting variable undefined because its only initialized inside IF condition and used below that code. In case IF condition is not true, variable never created and giving your error.

Simply initialized variable with empty string (or something else if its required DB field).

Here is your updated function

JavaScript

Also there is an error in html, form enctype is mis-spelled, and fix it and you will be receiving files on backend:

Yours

JavaScript

Correct one:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement