production.ERROR: Illegal offset type {“exception”:”[object] (TypeError(code: 0): Illegal offset type

Posted by

Error:

production.ERROR: Illegal offset type {"exception":"[object] (TypeError(code: 0): Illegal offset type at /opt/lampp/htdocs/myhospitalnow/mhn-core-ms/vendor/laravel/framework/src/Illuminate/Translation/Translator.php:150)
[stacktrace]

Solution:

Instead of giving your checkFile method a string or integer index, you are feeding it an array.

Make one of the following adjustments to address this:

Modify the checkfile such that it performs the checking using the array that was handed in.

if( in_array($file['type'], $type) )

Alter the code that calls this function to pass the file name as an index instead of the file array, as follows:

if( checkFile('Picture', array("image/jpeg") ) == true )

Either change will work.

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x