Laravel clear cache getting new error - laravel

I just cleared the cache for my project because my html wasn't updating and now I get and error something went wrong and it displays twice and I don't no what the error is how do I fix this could someone help me out please

at first
write access bootstrap and storage folder .
composer dump-autoload
run php artisan clear cache
then your problem will be solve

Related

Laravel View Cache keeps interrupting

I'm doing my thing in my normal view blade file, but when i edit my code and save it, it doesn't update. I found out that the view cache stored in /storage/framework/views keeps interrupting. Whatever i change in my normal blade file doesn't change the output. It only reacts to my cache, which doesn't update. I've already cleared my cache, but it doesn't work, it keeps coming back. Is there any way i can ignore or delete the view cache?
php artisan clear
php artisan route:clear
php artisan cache:clear
Run the above codes in your terminal it should do the trick, if it persists try reloading your editor.
Thanks for trying to help! The issue is gone now. Somehow i had 2 of the same blade files and i edited the wrong one, which is really weird. I don't know how i had 2 of the same blade files. I deleted one and now it works fine. Really weird though.
php artisan cache:clear
Try this.

laravel file is not updating

i have been working on my project for several week. everything was fine. but today all of a sudden i can not load some of my changed views (some i can change and get result). even if i change the controller, its still now working. according to SO and some other site i have tried followings
restart browser
clear browser cache, history(even tried new browser)
php artisan cache:clear
php artisan view:clear
composer dumpautoload
delete all files from storage/framework/views folder
delete all files from storage/framework/sessions folder
restart nginx server
what did i miss. thanks in advance.
Run php artisan view:clear command to clear views cache. If this won't help, delete all php files in storage/framework/views directory.
Another thing you should do is to check if you're calling the view you want. It happens in big projects with a similar views. Use Laravel Debugbar to display actually loaded views.

Laravel 5.2 reCaptcha fails after succeeds

So, I have placed the reCaptcha in my login form. I click on "im not a robot" and click on the right images and it says it succeeded, but when I submit the form it returns me the message of "The Captcha field is not correct." and it also thrown and exception saying:
'Illuminate\Foundation\Validation\ValidationException' with message
'The given data failed to pass validation.'
I am using "greggilbert/recaptcha" in my Laravel 5.2 project. I have set my keys and everything is working great in production and in other localhost's but not in mine.
My team and I work in the same git repository and it works for everyone but not for me.
I have re-installed the plugin, also the whole composer (by deleting vendor and then composer install).
I have cleared the configuration with php artisan config:clear and I've done the composer dump-autoload and have re-publish the ServiceProvider with php artisan vendor:publish --provider="Greggilbert\Recaptcha\RecaptchaServiceProvider"
Does somebody have any idea on how to fix this? Please!
Thank you a lot for reading this! Happy coding!

Blade view not reflecting changes

I am developing a Laravel(5.2.29) project in Windows environment and testing it on Chrome browser.
I have made some changes on a Blade file using atom text editor and then refreshed my page and noticed that suddenly it has stopped reflecting the changes (it's loading the old Blade file).
I've tried the following:
Restarted the browser
Clearing browser cache
Running php artisan cache:clear
Running composer dumpautoload
Deleting the Blade file (and got a view not found error). Then created a new Blade file with the same name, with no content and refreshed the page.
No matter what, the code displayed on the browser is always the same (old) version and not the content of the Blade file.
How can I solve this issue?
In order to avoid the parsing of Blade files on each reload, Laravel caches the views after Blade is processed. I've experienced some situations where the source (view file) is updated but the cache file is not "reloaded". In these cases, all you need to do is to delete the cached views and reload the page.
The cached view files are stored in storage/framework/views.
Run this command from terminal
php artisan view:clear
If you use PhpStorm, uncheck Preserve files timestamps deployment option:
https://stackoverflow.com/a/42534996/2453148
php artisan cache:clear
php artisan route:cache
php artisan config:clear
php artisan view:clear
rm -rf bootstrap/cache/*/*
Delete Cache/OPcache from PHP (fpm) of your Nginx/Apache server.
Clear the cache and clear the cached blade files:
php artisan cache:clear
php artisan config:clear
php artisan view:clear
You can also check if opcache enabled, in that case you need to clear your opcache cache.
Like Can Gelis mentionned in a comment. For me the solution was to reload PHP FPM
service php7.2-fpm reload
Alternatively if other suggested methods did not work, you can rename your files to different names. Refresh their corresponding web pages to start using new file name reference. Then you can rename the files back to your preferred names after the new pages to reflect their changes.
I have cleared all cashs and uploaded folders but didnt see changes.
Thus, if you have placed the project on a public hosting and don't have access to console then try to set deployment via your IDE (mine is phpstorm, e.g.)and set it to autoload mode. Then you'll get it working by changing something in the problem blade and by pressing cntrl+s(save) shortcut.
clear cache didn't work for me, but I just edited the file and saved it again, and it works!
None of these solutions have resolved this issue for me. Tried all php artisan options and the php code is not updating.
Only solution i've found is restarting the docker container that the code is running inside.
In case you try everything and nothing works. I recommend that you simply create a view under another name and the problem will be fixed
Example:
welcome.blade.php
change to
newview.blade.php
copy and paste code to new view
In controller just point to new view:
return view('newview');

Laravel 4.2 view:publish from custom location

I'm currently developing a package in L4.2 but I'm not using the workbench I have a complete custom structure.
But now I'm facing the problem that when I execute the artisan command view:publish I get the following error:
[InvalidArgumentException]
Views not found.
It seems like I have to give Laravel the location of my views but I can't find how to do this, so I hope anybody could help me.
My views are located at: vendor/package/src/views
My service provider at: vendor/package/src/serviceprovider.php
I also tried to use php artisan view:publish vendor/package --path="src/views" but no luck so far.
I hope somebody can help me,
Thanks,
Joren
php artisan view:publish td/longstack --path="packages/vendorname/packagename/src/views/"
Never mind I forgot to specify the folder where alle my packages are located. It works now.

Resources