Laravel: Uploaded Files URL problems with Custom Public Path - laravel

In my Laravel 5.6 project, I have moved the public folder path from /public to /web to match the hosting environment. The entire project works fine without any issues.
However, the problem appears when I upload files and try to link them. I have searched all over and cannot find any solutions to this. I have used php artisan storage:link to link the storage. I should be able to access files put in the folder by http://localhost:8000/storage/test.png but the link comes up with the view provided for the route /, not the actual file itself.
It's as if all links to the files are being treated as routes and are showing the default route page instead of the file. I would really appreciate any assistance.
Screenshot:
https://i.imgur.com/IPa6JYh.png

I found the solution to the problem.
In the file core/server.php, I had this:
if ($uri !== '/' && file_exists(__DIR__.'/public'.$uri)) {
return false;
}
The public part was causing the issue. I set it to /../web to match my project's structure and the file linking started immediately afterwards.
Hope this helps someone.
Edit: the core directory is where I have moved all the Laravel files. The screenshot in the question has more details.

Related

laravel not picking file through asset()

In my laravel project i am trying to get js file though asset('js/app.js') which is inside public folder. it is working fine on localhost but on server it is not picking file. It is working on another server. I think there is any issue with htaccess file.
I try to use url() and URL::asset() but not working. I checked source of page link is perfect but still fail to pick file
I want to access that js file.
The question has been answered in the comments, and was solved with this code:
asset('public/js/app.js')

Laravel File Manager dosn't load css, js files

I integrated Laravel File Manager in my laravel project and at first it worked properly, but after I remove public [ I followed this instruction remvove public from url ] from url it din't work anymore. The css file is missing and browse file also din't work. I tried to include those files**[css, js]** into head section also din't work. It still show like this
I have no idea how to fix this error. Can anyone help me please?

Issues with routes after putting my Laravel 5 project online

I have a problem when I put my laravel project online.
I extracted the contents of the public folder to the root and modified the contents of the index.php file accordingly.
but none of my routes are working anymore.
please can anyone help me?
thank you in advance ...
You can't move the public folder of a laravel installation.
Your web server must point to your public folder , usually :
/var/www/website.com/public

Laravel on a directory, links e.g. login link does not work

I have uploaded my Laravel app unto a directory under the public folder on my domain,
html_docs/public/store
where 'store' is the folder of my Laravel App. My main domain pointed at 'html_docs/public', please check my laravel app here "https://www.dinhi.org/store/". As you can see, when you click the "sell with us" or "login" on the top header, it returns
Not Found
The requested URL /store/dashboard/login was not found on this server.
I have set up to in my '.env' and in my 'config/app.php' the right url like "https://www.dinhi.org/store/" but still not working, any ideas, help please?
PS: I'm on Laravel 5.3 and I'm using Hesto Multi Auth. In my local, this issue does not exist like everything is good and working.
Laravel is not meant to be installed completely into the document root of your server. Actually, every folder of your laravel application except the public folder should be inaccessible from the web.
Your exposing yourself to a security risk here, since everybody could access every file of your app, including potential .env files with database credentials and the likes.
Cheers
Christoph

laravel 5 showing directory structure in vps

I have installed Laravel 5 in my vps form the instruction given in the "http://laravel.com/docs/5.1" link. It installed successfully but when I go to http://myipaddress/laravel it showing me the directory structure. I had check my php.ini file also for the "mod_rewrite" and it is showing in the loaded package, so where I am going wrong.
Access the public folder. That's where all your output content goes. http://myipaddress/laraval/public/
Edit:
One other thing. Don't name your project "laravel" as it may cause naming problems. Try to create a new project with a different name.

Resources