PLATFORM
  • Tails

    Create websites with TailwindCSS

  • Blocks

    Design blocks for your website

  • Wave

    Start building the next great SAAS

  • Pines

    Alpine & Tailwind UI Library

  • Auth

    Plug'n Play Authentication for Laravel

  • Designer comingsoon

    Create website designs with AI

  • DevBlog comingsoon

    Blog platform for developers

  • Static

    Build a simple static website

  • SaaS Adventure

    21-day program to build a SAAS

Question By
Solved

Very strange behavior that I cannot explain

Solved
alexmorning

Jun 28th, 2023 07:06 AM

So I was trying to modify the subscription tab of my account area some more, and I noticed that when I went to edit subscription.blade.php, the HTML in there did not match what I could see on my live site. which I thought was very weird, because I knew I had added custom class names/custom text to these so I knew it wasn't buttons generated by Paddle or anything. my subscription.blade.php file still had all the default Wave data in it from the git clone. But what was weird was that my local server was using the HTML from this file but my production server was not. Meaning, I made some very obvious modifications to this file and these changes reflected on my local server, but the changes were not reflected on my live production site.

chrome_2023-06-28-06-50-55.jpg

I thought maybe I added these to my script to ignore certain files when pushing to github and just forgot that I did it, but I checked and that was not the case either. I was losing my mind not being able to find where my live website was getting this information from, because I knew it was custom text that I had added/modified, and not just some default html buried in the Wave files.

Finally as a last resort I did a search of all my production server file contents and it turned up a result, and this result was in a file called /storage/framework/views/05deXXXXXXXfb616.php and this folder also has a lot of other cryptic file names in there as well.

ShareX_2023-06-28-06-59-16.jpg

I'm quite certain that I originally made changes to subscription.blade.php to get this new HTML on there...can anyone tell me how this file is now back to default (almost, there are a few small changes that I made very early on that are present in this file) and how there is this new auto-generated view only being used on my production site? Not a huge deal, but I just like to know why this stuff happens and if it was some kind of way that Laravel handled a conflict that I caused, or something else? Hopefully all of that makes sense, I can clarify if not.

thinkverse

Jun 28th, 2023 07:12 AM

Best Answer

Views found in /storage/framework/views are compiled and cached versions of view files, Laravel generated them on each request. Could be Laravel has decided to not compiled a modified version which it should do.

Cached views can be cleared with the view:clear artisan command.

You can read more on about it in the documentation for Optimizing Views.

Report
1
alexmorning

Jun 28th, 2023 07:19 AM

@thinkverse Ah okay, that makes sense. So I am confused, though. Whenever I search all my files for the HTML for that view, it only shows up one time in that cached file. What happens if I view:clear? I know I can just back up my server and try this and see what happens but I thought it might be helpful to others (and me) to also have that info here.

alexmorning

Jun 28th, 2023 07:25 AM

What's also weird is that the link you sent says if the uncompiled view has been modified recently then it will re-compile the view, but that isn't happening on my production server for some reason. I modified the original file and pushed it live just to see what would happen and nothing changed, meaning it was still using the cached view and not the file I just modified.

I'm just trying to figure out if I have some kind of configuration fuckery going on and this could cause problems later, or if there's something better I should be doing.

thank you again for the help.

superdev

Jul 5th, 2023 04:21 PM

It might be due to your APP_ENV being set to production and the autobuild procedure being applied to a development or staging environment.