Laravel 5.2 not loading any assets - laravel

None of my assets are loading in my project I've been using a virtual host and it won't load them from the resources/assets/js folder and I've also tried using localhost:8000 does anyone know why?

scripts or any related files that should be accessed via url should be stored in the public directory

Related

Configuring Laravel project in DirectAdmin server

I'm a newbie to Laravel projects but I need to have one accessible over the internet so I tried using DirectAdmin but whenever I go to my domain I get an index (pictures attached).
I renamed the Laravel 'public' folder to 'public_html', is that correct? Here is my file structure.
Here is what I get when I go to my assigned domain which isn't my website at all.
The webpage should look something like this
I also found a laravel app using Softaculous linked here (https://panel.freehosting.com:2222/CMD_PLUGINS/softaculous/index.raw?act=software&soft=419). Am I required to use this app?
At first, you need to learn about the laravel directory structure. You don't need to change the laravel public folder to public_html. I am not sure how the DirectAdmin server works. but if you see a laravel directory instead of serving an application it's might be a path-related issue in your server. your domain should serve your application public folder.
I just found a tutorial for the DirectAdmin server with laravel. that might help.

Why my configuration files are getting accessed from browser in laravel?

I have hosted my project on the server and my application is getting hacked, as of now I came to know my configuration files are no secured like .env, composer.json etc. These can be directly accessed by saying mydomain/filname e.g., www.abc.com/.env, when anybody hits url like this then file is opened on the browser. How can protect these files. I am using lravel 5.7
It seems you have multiple .htaccess files and your server isn't using the one that Laravel provides.

Assets not loading in localhost for a laravel app

I have an application which has developed on laravel 5.7 and it's index.php is moved to root directory. Now when i tried to make the server up using php artisan serve command.
The website was loading but assets files like css and js not loading. Entire console showing errors and when i tried to see the asset file code through http://localhost:8000/assets/js/app.min.js
It was showing Error 404
The page you are looking for does't exist.
Can any one help me i am trying to resolve from past two days
Entire app is loading only view is not proper due to non loading of asset files

laravel Asset() function break down after deployment

I developeded a Laravel web app, which works fine and great on local machine but
after going in production on a shared hosting server i have some issues displaying the logo and the website images using the asset() helper function.
However the css and js are accessible and works fine (also using the asset function).
I've deployed the App following the steps bellow:
I created a directory called repositories outside the public_html (the root document of mydomain.com) and i copied inside it directory soukelafalah (contining all the files of my laravel project)
I moved the laravel public directory files into the public_html directory
I edited the index.php in public_html as follow:
require DIR.'./../repositories/SoukElfalah/vendor/autoload.php';
$app = require_once__DIR__.'/../repositories/SoukElfalah/bootstrap/app.php';
I run php artisan storage:link and the link is succufully created
I had run also:
ln -s /home/dtruxpgw/repositories/SoukElfalah/storage/app/public /home/dtruxpgw/public_html/storage
The route and the css is working fine but the logo and the images are not displayed and shows a 404 error as shown in the image below.
So please, can any one point what i am missing?
And when i put asset('/storage/images/thumbs/'.$img_name)}}" am i pointing to the storage directory in the public_html or in the one in the public folder of my laravel app directory.
Thank you in advance.

How to publish a directory from Joomla

I have a website created using joomla 3.0 (bitnami on amazon aws). I want to publish few files (html) from the website and was wondering how to do it ? Ideally I want to keep those htmls under /opt/bitnami/apps/joomla/htdocs/storage/matrix.html and then access it from my site using url : /storage/matrix.html
Any clues ?
I found the solution myself after trying out a few things. What I did was created a new directory called storage under htdocs (of my joomla installation) and then also copied a htaccess.txt file inside it (from another public folder). And that's it ! This directory is now public and I can access it like I wanted !

Resources