Changes are not applied to the blade page after the deployment - laravel

There is an AWS EC2 instance on which the laravel application is deployed. Cloudflare is also connected to it. I pushed the simplest change for the blade page, which changes the color of the title, but the page has not changed in any way and looks the same.
I am sure that the changes got to the server, connected via ssh and manually looked at the blade file.
I've tried the artisan commands cache:clear, view:clear, config:clear. I manually cleaned the storage/framework/views and bootstrap/cache/ folders.
I was deleting the cloudflare cache and switched to developer mode.
None of this helped.
What other cache cleanup options did I miss?

The problem was in CloudFlare Rocket Loader. Everything worked after I turned it off.

Related

Updated Image file but not reflecting on Live server in laravel 9

I'm new with Laravel and I made web application but when I updated the image file or some css code it will not reflecting on live server.
I tried:
Route::get('/check',function(){ Artisan::call('cache:clear'); Artisan::call('optimize:clear'); Cache::flush(); });
but this is not working.
I just want to reflecting updated image file or css file when I update it.
"it will not reflecting on live server"
This is the bit that worries me being you've tried the cache clear commands. Laravel will mostly serve up the current assets, there are of course exceptions!
Laravel octane; If you're using this package then php artisan octane:reload
Other sources for these sorts of errors to check first would be
Browser cache - try renaming the files or adding a query string to their lings.
CDN cache - lots of people use cloudflare as a CDN and DNS, make sure development mode is turned on and you've flushed the cache there.
For the most part, just adding a query string and/or changing the name should be enough to prompt a fresh download.

How to fix broken Laravel link to local file system?

We inherited a custom laravel app and in the admin area, a link that points to a file in the local storage has broken:
This site can’t be reached
The webpage at https://domain.tld/admin/donor/1818/document/56/DCCA8ACC-7B1B-4D90-977C-257BDA5AE56E.png might be temporarily down or it may have moved permanently to a new web address.
ERR_INVALID_RESPONSE
These links used to work, so I'm not sure what broke. I've verified that the all folders and files in the app have correct permissions and ownership.
You need to make the storage public if you didn’t set it up.
php artisan storage:link
See the docs for more details.

File session driver not working properly on production (Laravel on shared hosting)

When using session on my local environment all worked ok, but when I publish the site in a shared hosting I started noticing some strange behaviours in the app. After a while I realized it has to do with the session and specifically I noticed that when I was working on my local environment the storage/framework/sessions folder only had 1 file that keep updating on any change but then on production I start monitoring the same folder and I realized that on any change instead of updating the file (or creating a new one and deleting the other) it was creating a new file but also keeping the old files making the app start acting in a wrong way.
Is this normal or should it be only 1 file per session as it was in the local environment?
Update
After login the user the app ask to select the business they want to work and also they can change between business after, to store the business they choose I use the session and there is where the problem pop, after every change on that property of the session it creates a new session file without deleting the old one. Again when I do exactly the same thing locally it works but for some reason on the shared hosting it doesn't.
SOLUTION
After days of trying to figure it out, I just figure out the solution.
Instead of using the Global Helpers of Laravel for storing the data I did it throw the request and apparently that work it out.
So basically instead of doing this:
session('clienteElegido' => $client);
I change it for this:
$request->session()->put('clienteElegido',$client);
I still don't understand what's the difference and why it was working fine in my local environment and not in the share host but its working now like that so all good.
Thank you for all the quick replies.
Try clearning cache, route, config and view
php artisan cache:clear
php artisan route:clear
php artisan config:clear
php artisan view:clear
and let's see if your session issue will be fixed.

Updating a hosted 5.3 laravel web site in BLUEHOST

I'am currently working on a hosted web site which was developed with Laravel 5.3 in Bluehost . So for futher developments I have folled below procedure.
Compressed the folder and downloaded it in to local machine.
Created a public folder and moved relevant folders into it.
Via php artisan serve develpment started and everything went fine.
After the development only 4 files to be changed in the server. So I have opened the related files in server and updated the coding by just copy and paste.
When I refresh the web url after updating files I can see that php
and html updated correctly but css and javascript was not
updated. So I checked the files again but they are almost updated. But
when I view the source I can see that both css and javascript
files have not updated.
So I just created new files in the server with different names and linked them into the blade.php files and then css and javascript working fine .Also when I view the source they are also updated.
Can anyone say what is the reason for this?
This happens due to caching most of the time.
If you are using Cloudflare as a service purge the cache and give it a try.
Steps to purge your domain cache due to Cloudflare
STEP 01
Login to your Cloudflare account and select the domain you want to purge the cache.
STEP 02
Go to the caching tab.
STEP 03
In there, there are two options you can select. one is, you can purge the cache on selected file by simply given the URL of the file you want to purge the cache.
the second one is you can purge all cache in Cloudflare server under your domain by clicking purge everything button.

Laravel FileZilla upload/download

Is there a proper explanation as to why when I'm either pulling the complete project from the server, or pushing it on server, views don't get updated? I always have to manually go to the resources folder and transfer views after everything has already uploaded/downloaded.
The solution is to clear your cache like stated in the comments.
php artisan view:clear
The reason why this is happening is because by default the caching is set to File. Which means that the view-cache is stored in files. When you upload everything the old-cache is uploaded. The files are stored in storage\framework\views
If you upload a single folder, laravel notices a change and the cache is busted.
PS: it is recommended that you use git for this kind of stuff, Laravel has .gitignore files to prevent this kind of behavior.

Resources