4

I am using Laravel 8. My site's public directory is public_html and I have made the appropriate changed to the appservice provider:

 public function register()
{
     $this->app->bind('path.public', function() {
            return base_path().'/public_html';
     });
}

and changed the lfm is config to

'base_directory' => 'public_html',

The filemanager is uploading to the correct directory and making thumbnails in a subdirectory correctly, but it's view is a broken symbol.

I appreciate any help.

Jim
  • 596
  • 1
  • 10
  • 36
  • have you re-run `php artisan storage:link` after you made your changes? And changed the SymLink paths in filesystems config file? https://laravel.com/docs/8.x/filesystem#the-public-disk – Rory Nov 10 '21 at 19:11
  • I have changed the filesystem to `'public' => [ 'driver' => 'local', 'root' => storage_path('app/public_html'), 'url' => env('APP_URL').'/public_html', 'visibility' => 'public', ], ` but still the URL is given as `` The storage link has been run. – Jim Nov 11 '21 at 08:02
  • Can you show the code you are using to display the image? – Rory Nov 11 '21 at 18:02
  • It is called by CKEditor – Jim Nov 12 '21 at 20:10

2 Answers2

0

You have to bind the new storage path to the app instance. Please try this:

AppServiceProvider

public function register()
{
    $this->app->instance('path.storage', base_path() . '/public_html');
}
Maik Lowrey
  • 15,957
  • 6
  • 40
  • 79
  • I have already got such a binding: $this->app->bind('path.public', function() { return base_path().'/public_html'; }); – Jim Nov 10 '21 at 07:01
  • @Jim they different. Take a look please. You can replace them and try it out. – Maik Lowrey Nov 10 '21 at 07:14
  • It has made no difference. It is giving the route as https://quislingmovie.com/laravel-filemanager/photos/shares/6183cadfd8b51.jpg – Jim Nov 10 '21 at 14:22
0

Just get rid of the /laravel-filemanager/ prefix from the src URLs. you have got the photos as a route. example:

https://quislingmovie.com/photos/shares/6183cadfd8b51.jpg

https://quislingmovie.com/photos/shares/6183cadfd8b51.jpg

enter image description here

Abilogos
  • 4,777
  • 2
  • 19
  • 39
  • @Jim I didn't understand that "amendment stopped the whole site working!" . are you talking about the "substituting the url" or another amendment? – Abilogos Nov 16 '21 at 19:36
  • I have reached out your website, and i didnt noticed any problem. actually one of the pictures on the answer is serving from your website – Abilogos Nov 16 '21 at 19:36
  • 1
    The problem is filemanager is not showing the items properly. The images are OK because I had remove the extra part of the URL. – Jim Nov 21 '21 at 11:16
  • @Jim so the problem with the question (not showing the picture) has been resolved with correct url. – Abilogos Nov 21 '21 at 11:33
  • "The problem is filemanager is not showing the items properly." is another problem i guess. – Abilogos Nov 21 '21 at 11:33
  • Yes. It is just not working properly – Jim Nov 22 '21 at 15:48