when upload an image, "/laravel-filemanager" added to first of urls.
and in site that url not show if user not logined.
I agree. Also, when I set 'base_directory' to 'public/storage' accessing files via my.domain/laravel-filemanager/file_path has no sense. [By default 'base_directory' is set to 'public', so even then special route has no valid reason]
i delete 20 first charecters by sub_str. But this is not the right way. plaese say how fix it.
@farshidrezaei
in site that url not show if user not logined.
This was fixed in the latest version.
And if you set base_directory to public, laravel-filemanager won't be included in urls.
@g0110280
but i have to change base_directory, because i use shared hosting.
and I have some articles that do not require authentication.
what i do?
I think there should be an additional option that adds the prefix to the path if desired. I'm just having to modify the returned urls in javascript to strip the prefix out.
@VizuasLOG
Why should /laravel-filemanager/ exist?
how do you work around this? is there a way to avoid adding the "/laravel-filemanager/" path? I though i had it, but I still can't make it work 馃槩
I ended up removing this piece of code to remove the " /laravel-filemanager/" path :

[\vendor\unisharplaravel-filemanager\src\traits\LfmHelpers.php]
@cakesforfree
and it's work?
yes.
this is my config/lfm.php

@cakesforfree If I read your first screenshot correctly editing the 'prefix' config so it's an empty string accomplishes exactly the same thing. I don't see that option in the config though. Could it be that that first parameter in the config helper function should actually be 'url_prefix'?
Edit: sorry, I checked the master branch. the latest release still has that config option
@cakesforfree did you find the problem? (since you removed the screenshots you posted just now ;) Let me know, i'm here to help
@gwleuverink sorry, i am not sure if I understand your question, but if I leave the "prefix" option empty, in my config file, it gives me a NotFoundHttpException error.

Okay. sorry it seems I was a bit confused as to what the problem you are experiencing is exactly. Do I understand correctly that the 'laravel-filemanager' prefix in the route you are using is not the problem, but rather that all images that are loaded have that prefix in the url also?
That might have something to do with the 'base_directory' value in your config.
Can you post a folded out project structure here?
You have to change the lfm.js (public/vendor/laravel-filemanager/js/lfm.js).
In that file you can see the url /laravel-filemanager.

The problem is in the getPathPrefix function, around line 112 in LfmHelpers.php
if ($type === 'url' && $base_directory !== 'public')...
I've configured the LFM to use the public/upload base directory. And because of this the function will return the laravel-filemanager prefixed path, if the base_directory config is not public. I don't know the reason of this, but for me the temporary solution was to change back the base_directory config to public, and the images_folder_name to `upload/img'. This is a hack, but working.
But please fix this somehow please.
I ended up removing this piece of code to remove the " /laravel-filemanager/" path :
[\vendor\unisharplaravel-filemanager\src\traits\LfmHelpers.php]
It worked for me. Thanks a lot
Go in \vendor\unisharplaravel-filemanager\src\traits\LfmHelpers.php and
Change this
```
public function getPathPrefix($type)
{
$default_folder_name = 'files';
if ($this->isProcessingImages()) {
$default_folder_name = 'photos';
}
$prefix = config('lfm.' . $this->currentLfmType() . 's_folder_name', $default_folder_name);
$base_directory = config('lfm.base_directory', 'public');
if ($type === 'dir') {
$prefix = $base_directory . '/' . $prefix;
}
if ($type === 'url' && $base_directory !== 'public') {
$prefix = config('lfm.url_prefix', config('lfm.prefix', 'laravel-filemanager')) . '/' . $prefix;
}
return $prefix;
}
To this
```
public function getPathPrefix($type)
{
$default_folder_name = 'files';
if ($this->isProcessingImages()) {
$default_folder_name = 'photos';
}
$prefix = config('lfm.' . $this->currentLfmType() . 's_folder_name', $default_folder_name);
$base_directory = config('lfm.base_directory', 'public');
if ($type === 'dir') {
$prefix = $base_directory . '/' . $prefix;
}
if ($type === 'url' && $base_directory !== 'public') {
$prefix = '/' . $prefix;
}
return $prefix;
}
Let me know, now image file save this format http://localhost:8004/storage/files/shares/Group66.png and want to change /storage/files/shares/Group66.png and how to remove app url in db
Most helpful comment
The problem is in the getPathPrefix function, around line 112 in LfmHelpers.php
if ($type === 'url' && $base_directory !== 'public')...I've configured the LFM to use the public/upload base directory. And because of this the function will return the
laravel-filemanagerprefixed path, if thebase_directoryconfig is notpublic. I don't know the reason of this, but for me the temporary solution was to change back thebase_directoryconfig topublic, and theimages_folder_nameto `upload/img'. This is a hack, but working.But please fix this somehow please.