Hello,
I'm trying to change the structure of the laravel. Basically on the dedicated virtual server I have created a folder called laravel and I added all the laravel files inside there and all the contents of the public inside the public_html. Then in the index.php (the file in the public_html) I did the following changes.
require __DIR__.'/../laravel/bootstrap/autoload.php';
$app = require_once __DIR__.'/../laravel/bootstrap/app.php';
$app->bind('path.public', function() {
return __DIR__;
});
The project is working, the issue now is that because I have changed the structure I have affected some libraries that I'm using. For example the module media ( https://github.com/AsgardCms/Media )
When I'm trying to upload an image instead of uploading inside the public_html/assets/media, where public_html is www, it's trying to create a public or public_html inside the laravel folder. I have added the following code to change the public to public_html, but it seems it is not working. Can anyone help to keep this structure and fixing the paths?
Here is the code of the Media how it saves the images
public function store(UploadedFile $file)
{
$savedFile = $this->file->createFromFile($file);
$path = $this->getDestinationPath($savedFile->getOriginal('path'));
$stream = fopen($file->getRealPath(), 'r+');
$this->filesystem->disk($this->getConfiguredFilesystem())->writeStream($path, $stream, [
'visibility' => 'public',
'mimetype' => $savedFile->mimetype,
]);
$this->createThumbnails($savedFile);
return $savedFile;
}
Here is an image of my directory structure on my server.
http://postimg.org/image/xd5ucom9d/
P.s: the project is based on the asgardcms