When DB column is named file (_which is pretty usual_), upload field breaks.
This is a Backpack 4.1 bug. Previous versions were working fine.
My db column is named file. Wanted to add an upload field for this db column.
Work as usual.
Turns out that if a db column is named 'file', in the file wrapper_start.blade.php, there is a check if the attribute is a callback or a string.
When it does this check, it calls the php function: is_callable().
The problem is that file, which is the attribute name, is also a php native function.
This makes backpack think that this is a callback and not a string and tries to call the php function file().
The problem is under the file wrapper_start.blade.php. Cannot solve without a PR.
When I run php artisan backpack:version the output is:
### PHP VERSION:
PHP 7.4.5 (cli) (built: Apr 23 2020 02:25:56) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.5, Copyright (c), by Zend Technologies
### LARAVEL VERSION:
v7.13.0@6fa69bfbd57744a5bbec5538ce483919b3fd625f
### BACKPACK VERSION:
4.1.6@cbd4143d3eb8302916012af205565cd3183f274f
Hello @robertotcestari
This is already fixed. #2862
Best,
Most helpful comment
Hello @robertotcestari
This is already fixed. #2862
Best,