Editing Views from Framework Folder - Laravel 5.6 - php

I am not able to edit my views from resources/view but rather i have to edit from storage/framework/views. Why is this happening with my project suddenly. Is there a way i can change this?

Laravel is caching your views try clearing views cache
php artisan view:clear

Related

Why Laravel 7 Generates Views in /storage/framework/views/, and how to stop creating them?

Laravel keeps generating views simultaneously with the views I am editing.
-storage
-framework
-views
-0e4e52af70801a529019b11f786c45e07ca41a01.php
-2c29d7cd1ffcb89dff8d91bbd62bedc5176cb6fc.php
You can do that but for that you have to edit Laravel's core files, it is not advisable.
You can delete the views generated in storage folder by using following artisan command.
php artisan view:clear

Laravel routing cache

When I develop a Laravel application I used to clear cache after making any changes to routes\web.php or routes\api.php. Recently I was working on a project for a fellow and found out that the project does not need clearing cache every time I make a change in any of the files I have mentioned.
So I want to know what is the problem with the autoloader or what exactly is the general problem?
When you use commands like
php artisan optimize
php artisan route:cache
your route files(under routes/) are being parsed and cached. Now, next requests will be routed from cached routes, not from routes/*.php.
If you have used above commands, after making changes to route php files, you should re-cache them, or use
php artisan route:clear
to remove the cache. Then, next requests will be routed by routes/*php files.

Laravel 5.4 does not see changes in files

I'm using Laravel 5.4 on Windows 7 and Xampp 3.2.2. A few days ago Laravel started ignoring the changes I was making to the .env file. I couldn't find the solution so I reinstalled Laravel in a different directory and imported my app folder.
Now Laravel just stopped responding to the changes I am making to some PHP files. I added a function to the /vendor/illuminate/support/helpers.php but I could not access it in the view. I deleted the content of the whole file and I could still access the function previously declared in it.
I created a helpers file as instructed here but that too is being ignored.
Any changes to any views is immediately effected and php artisan cache:clear is not doing anything.
How is this happening? Does it even make sense?
Laravel caches config values to improve performance.
You need to run either (recommended)
php artisan config:cache
which will cache the new values you have, or
php artisan config:clear
which will turn off caching. I've had some experience with this causing errors though.
I know it might sound rather stupid, but have you remembered to restart the server because you've edited the .env file?

Error when I duplicate laravel project and show me the last view

I have a Laravel 5.3 project which was created 5 months ago, today I made a duplicate from the project and I made some changes into the code.
When I edit the views in a blade.php file my project which I edited showed me the last project view, I made a new route in the new laravel project and in the routes works well, but still shows the last project view.
It's funny because the js files works pretty well, but the view doens't work. for example, I edit the profile.blade.php file and it shows the content from the last project, if I writte something new in the other view from the last project, it shows in the new project.
Any ideas?
Thanks in advance.
Your views/routes are compiled/cached.
The storage directory contains your compiled Blade templates, file
based sessions, file caches, and other files generated by the
framework.
The bootstrap directory contains files that bootstrap the framework
and configure autoloading. This directory also houses a cache
directory which contains framework generated files for performance
optimization such as the route and services cache files.
Run these commands
php artisan view:clear - Clear all compiled view
php artisan optimize --force - Optimize the framework for better performance
php artisan config:cache - Create a cache file for faster configuration loading
php artisan route:cache - Create a route cache file for faster route registration
Disable opcache from php.ini or use:
ini_set('opcache.enable', 0);

Laravel 4.2 View caching issue

I am updating view and refreshing the route which is rendering that particular view. But it loads previous view. After multiple refresh I get the latest updated view. Can you please explain me in detail how my view should not be cached and i should get updated view only.
In Laravel 4.2 you can't run the command php artisan cache:clear to remove the views. That's because they aren't cached, their compiled.
Laravel 5.1 and greater implemented the command php artisan view:clear to clear compiled views, but here is a custom command you can use in Laravel 4.2 to clear them:
https://gist.github.com/cjonstrup/8228165
Otherwise, just delete all the files in app/storage/views and views will be re-compiled.
I'd recommend to set debug to true, open your browser dev tools and check the option to don't cache pages when dev tools are opened and finally, give 777 permissions to you storage folder (I don't remember the name of the folder in Laravel 4.2) where compiled views are stored as sometimes the system can't write on that location.
I think it should be enough for you to get the view updated on refresh.

Categories