barryvdh / laravel-elfinder

elFinder bundle for Laravel
738 stars 171 forks source link

laravel elfinder does not work after renaming public folder to public_html on the server #143

Open ahmadbadpey opened 8 years ago

ahmadbadpey commented 8 years ago

I am using laravel-elfinder laravel package as a file Manager in laravel project.

To determine folder that all files uploaded to it , I used dir option in elfinder config file,that seems is relative to public project path.

I store all files on a directory named upload in public folder project and same on the server. but on the server I must use public_html.

Now , when I want to create an instances elfinder bellow error shown:

Invalid backend configuration. Readable volumes not available.

All things work on the localhost without any problem.

How do I must set dir option in elfinder config file?

baddwin commented 7 years ago

Does someone have solution already?

dcblogdev commented 6 years ago

I solved this issue today by binding the public path to the directory my index.php file is.

Open public_html/index.php and add the following binding after including app.php

$app = require_once __DIR__.'/../../laravel/bootstrap/app.php';

// set the public path to this directory
$app->bind('path.public', function() {
    return __DIR__;
});