Operating system: Ubuntu 16.04.3 LTS (Running in Homestead v5.0.1)
Laravel version: Laravel Framework 5.5.28
Package version: "~1.8"
Steps to reproduce issue:
Just open http://my.app/laravel-filemanager in browser
(It has been working for quite a while before so this is a new issue. Not sure if it's related to package upgrades or similar.)
Should also note that I can still accesss laravel-filemanager from the standalone buttons I have in my application's forms.
Screenshots:


Log entry with stack trace
`[2018-01-11 12:36:35] local.ERROR: Type error: Argument 1 passed to Doctrine\Common\Inflector\Inflector::singularize() must be of the type string, null given, called in /home/vagrant/code/bootstrap/vendor/laravel/framework/src/Illuminate/Support/Pluralizer.php on line 84 {"userId":1,"email":"[email protected]","exception":"[object] (Symfony\Component\Debug\Exception\FatalThrowableError(code: 0): Type error: Argument 1 passed to Doctrine\Common\Inflector\Inflector::singularize() must be of the type string, null given, called in /home/vagrant/code/bootstrap/vendor/laravel/framework/src/Illuminate/Support/Pluralizer.php on line 84 at /home/vagrant/code/bootstrap/vendor/doctrine/inflector/lib/Doctrine/Common/Inflector/Inflector.php:441)
[stacktrace]
"}
`
I was about the post the same issue! I tried downgrading to 1.8.3 and 1.8.2, but I'm getting the same error, so I guess it has to be a problem with some dependencies breaking their API?
If anyone has found a solution, please share!
I'm having the same error.
Try this: replace line 335 of LfmHelpers.php from
return lcfirst(str_singular(request('type'))) === 'image';
to
return lcfirst(str_singular(request('type') ?: '')) === 'image';
I saw this line from your backtrace:
Doctrine\\Common\\Inflector\\Inflector::singularize(NULL) #1
This issue might be cause by an upgrade of Doctrine package.
In lfmhelpers.php line 335 replace the return with this:
return lcfirst(str_singular(request('type') ? request('type') : '')) === 'image';
and in vendor/unisharp/laravel-filemanager/src/views/index.blade.php line 209 replace with this:
acceptedFiles: "{{ lcfirst(str_singular(request('type') ? request('type') : '')) == 'image' ? implode(',', config('lfm.valid_image_mimetypes')) : implode(',', config('lfm.valid_file_mimetypes')) }}",
maxFilesize: ({{ lcfirst(str_singular(request('type') ? request('type') : '')) == 'image' ? config('lfm.max_image_size') : config('lfm.max_file_size') }} / 1000)
Hope this helps, it works in mine.
Solution works great. Thanks! LOVE this package.
Works for me as well! thanks!
A simpler solution that still allows you to run composer update is to add the previous version of inflector to composer.json require:{ "doctrine/inflector": "v1.2"} until this issue has been patched.
@paulkn's solution worked for me, I will be waiting for the fix to remove the inflator from composer.
Any news about it?
Bump.
Having the same issue
having the same issue error when accessing to laravel-filemanager with this error
ype error: Argument 1 passed to Doctrine\Common\Inflector\Inflector::singularize() must be of the type string, null given, called in C:\wamp64\www\OTCfinal\vendor\laravel\frameworksrc\Illuminate\Support\Pluralizer.php on line 79

@alalfakawma it worked for me now. thanks.
In my case, I edited in resources/views/vendor/laravel-filemanager/index.blade.php 馃拑
Any Update on this ?
We need an update...
Did you try @paulkn鈥檚 solution? That worked for the embedded Iframe.
If so, what have you tried? What are your errors and what are you trying to achieve?
"doctrine/inflector": "v1.2" it worked for me
Downgrading inflector works fine...until the issue is patched. Is there anyone who has sent a PR for this ??
Fixed in aaf2764f.
Most helpful comment
In lfmhelpers.php line 335 replace the return with this:
return lcfirst(str_singular(request('type') ? request('type') : '')) === 'image';and in vendor/unisharp/laravel-filemanager/src/views/index.blade.php line 209 replace with this:
acceptedFiles: "{{ lcfirst(str_singular(request('type') ? request('type') : '')) == 'image' ? implode(',', config('lfm.valid_image_mimetypes')) : implode(',', config('lfm.valid_file_mimetypes')) }}", maxFilesize: ({{ lcfirst(str_singular(request('type') ? request('type') : '')) == 'image' ? config('lfm.max_image_size') : config('lfm.max_file_size') }} / 1000)Hope this helps, it works in mine.