Laravel 6.2 on AWS elastic Beanstalk. Assets not loaded - laravel

I have hosted a laravel 6.2 app on AWS elastic Beanstalk. Previously everything was working fine when the site was static, but after I created an RDS instance and made the site dynamic, the site still works fine, but the javascripts and css file I have kept inside the public folder are not being loaded.
First, I thought this might be something about the file permissions. So I made 'webapp' the owner of public folder and changed it's mode to 777. The javascripts and css still wont load. No error is shown in the network tab of browser dev tool.
I do I go on and solve this. I am finding it hard to find an approach.
Here's a screenshot of the result of ls -l in the root directory of my app.

Related

Run an app from a subfolder in the public folder of a Laravel app

I need to install a custom app in a subfolder of my site, and make that publicly accessible. Like mysite.com/results, where inside the results folder will be a custom JS app responsible for displaying results of some running / cycling events.
Update
By custom JS app I mean a bunch of files that comes from the race timing software I use, so I have no control of the files there, just need to be able to make them accessible.
If I create an index.html in that folder, it works, but if I create an index.php it does not work.
I use Valet on my dev machine and my website is being deployed with Ploi deploy.

How to fetch newly added images from VM in google cloud platform?

When I add images it is stored inside google cloud platform VM correctly.
But I am not able to fetch newly added images in my website.
If I redeploy project with newly added images in assets folder it is showing correctly.
I have verified there is no mistake on frontend or backend side.
Is it not possible to get live image update with VM?
Edit:
I have used Vue.js.
I am storing images inside src/assets folder.
When I save images in my website it is saved at src/assets folder.
I think it can only access things in dist folder after build.
Can you suggest where should I save my file?
I'm making an educateg guess it's some cache issue.
Instead of putting your image files inside the VM you can try storing them in a bucket that's accessible to public. The downside is that it can serve only static files (no PHP or anything).
You have to configure your load balancer to forward all your.domain.com/images/ requests to the bucket but that's actually quite easy. Have a look at my answer asking for such configuration.

Laravel Vapor - Assets (logo) on maintenance mode page

According to the docs we are able to put a 503.html document inside the root of our Laravel project.
You may customize the maintenance mode splash screen for your application by placing a 503.html file in your application's root directory.
I would however love to be able to put one or more assets on this page (for example our Logo) to make this page better more personal. Laravel Vapor automatically uploads your static assets to cloudfront, which is not a problem if you're using the asset() helper. However, are there any solutions already being made? I can't find any.
Is there anyone who has created a solution to make this happen?
With Vapor every time you deploy all the assets get a new cloudfront url. This is mostly fine for js and css which we change often. Images, logos etc do not change much.
Better to make another bucket on aws and hard code the path the image file in your 503. Doesn't need to be deployed every time. Your users browsers can cache it for as long as you set it in the bucket.
I'd like Vapor to only change asset urls if the files have changed but so far that is not the case.

How to host Laravel project on Raspberry Pi

I have scoured the depths of the internet for this solution and I come up empty handed. I have installed apache server on my pi and when I access the IP address from another computer, it pulls up the correct index.html page. So the server is working fine. My problem is that I can't get my Laravel app to work. When I deploy my laravel apps to other hosting sites, I put everything except the "public" folder into a separate folder in the file tree, and edit the index.php file in the public folder to match the new file structure of pointing to the autoload.php and bootstrap files. None of that is working for me in the apache server on the Pi. Can someone tell me how to do this or where there is legitimate documentation on how to do it. Please don't point me to any google articles that come up in the first 3 pages because i've read and tried them all.
The only thing that happens right now is that when i go to "IPaddress/project_folder" in the URL, it just brings up the file tree in the browser as opposed to pointing to my "/" route within the laravel project.

Laravel Spark prject links not working

How I create and run laravel spark project:
Create project using spark new myproject
set all required directory permissions
Since I am on live server I hit the public folder within the project.
The page display with two buttons 'Login' and 'Register'
When these buttons are clicked it jumps to the root directory, nothing works
Even if i hit the url like 'http://myip/myproject/register' the registration does not work.
What I am missing. please guide. I can't create virtual host.
You're using wrong web server configuration. You web server is pointed to a root directory where Laravel project lives.
You need to point it to a public directory which is inside Laravel project and restart web server.
After that use normal URLs without public in it.
Update
Correct nginx and Apache settings for Laravel 5

Resources